Q:

Make SQLite abort on first error (and sing songs)

I wanted to name this post Make SQLite abort on first error but StackOverflow's AI overlords decided it doesn't fit their conception of intelligent human behavior. For the record, I was googling exactly that, but perhaps even Google AI considered my question unworthy and didn't bother to help me. Mods, feel free to change the title according to what your AI bosses desire (if you can figure it out).

I have this script
create if not exists table entries (
    id integer primary key,
    start datetime not null,
    end datetime not null
);

delete from entries;
insert into entries values (1, '2018-08-01 10:00', '2018-08-01 15:00');
insert into entries values (2, '2018-08-01 17:00', '2018-08-01 20:00');
insert into entries values (1, '2018-08-02 19:00', '2018-08-02 00:00');
insert into entries values (1, '2018-08-03 00:00', '2018-08-03 04:00');
insert into entries values (1, '2018-08-03 14:00', '2018-08-03 18:00');

There is a mistake in create statement. When I run the script I get
% sqlite3 db.sqlite3 <ddl.sql
Error: near line 1: near "if": syntax error
Error: near line 7: no such table: entries
Error: near line 8: no such table: entries
Error: near line 9: no such table: entries
Error: near line 10: no such table: entries
Error: near line 11: no such table: entries
Error: near line 12: no such table: entries

How do I make SQLite exit executing the script on first error it encounters? I'm looking for equivalent of set -e in Bash.

A:

From the documentation, it looks like you can turn on the dot command .bail.

.bail on|off           Stop after hitting an error.  Default OFF

See also - O'Reilly Using Sqlite
Edit
To exit, you can use the .exit dot command.

