Hi there.
I don’t know whether it’s a feature of the LE not relaying any errors from SQLite, but I’ve spent a bit of time trying to re-create your issue.
If I write something in the SQL query to force SQLite into an error, the entire query is halted at the point of the error as one would expect.
In your case, even if I remove your opening line of “Breakk the program test”, your SQL query looks like:
CREATE TABLE friends (
id INTEGER,
name TEXT,
birthday DATE,
);
INSERT INTO friends (id, name, birthday)
VALUES (1, "Jane Doe", 1990-05-30);
INSERT INTO friends (id, name, birthday)
VALUES (2, "Jack", 1995-02-15);
INSERT INTO friends (id, name, birthday)
VALUES (3, "Grayson", 1996-06-15);
SELECT * FROM friends;
The cause of your error is the trailing comma at the end of your table declaration.
If we look at the syntax diagram for the CREATE TABLE
statement in SQLite, which I have reproduced from their documentation pages here, we can see the following:
I have highlighted the appropriate section with orange; this is the column_def
section.
In the syntax diagram, you can see how the flow arrows only go to the comma after a column definition (like id INTEGER
for instance) when we are gearing up to declare another column.
If I remove that trailing comma from your SQL, the LE runs your query fine:
Can you please re-try the query without that trailing comma? It ought to run fine after that.
Edit: To be sure, I spun up a REPL to check that I’m not talking nonsense. If I try and run the query with the trailing comma in the CREATE TABLE
expression on line 1, I get this: