const query = generatedSchema.sql<{
}>`SELECT * FROM genres`;
Matching case in column and table names
Ignore column and table case in the queries:
const query = schema.sql<{
Name: string | null
}>`SELECT Name FROM artists`;
Without matching case, column selection fails:
const query = schema.sql<{/*
Could not find selected column name in from clause
*/}>`SELECT name FROM artists`;
Missing Semicolons
Have a user friendly error message when defining schema and forgetting a semicolon or two:
CREATE TABLE "albums"
(
AlbumId INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
Title TEXT(160) NOT NULL,
ArtistId INTEGER NOT NULL,
FOREIGN KEY (ArtistId) REFERENCES "artists" (ArtistId)
ON DELETE NO ACTION ON UPDATE NO ACTION
)
CREATE TABLE sqlite_sequence(name,seq)
Braces from SQL definition
Ignore braces in column names, as they are in the
sql
column from thesqlite_schema
table:Quotes in table names
Ignore quotes in the table names:
Without quotes, column selection fails:
Matching case in column and table names
Ignore column and table case in the queries:
Without matching case, column selection fails:
Missing Semicolons
Have a user friendly error message when defining
schema
and forgetting a semicolon or two: