How do you make sure SQLDelight actually runs .sq ...
# squarelibraries
m
How do you make sure SQLDelight actually runs .sq files? I have a file that is defined as
Copy code
import kotlinx.datetime.Instant;

CREATE TABLE Entry (
    id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
    timestamp TEXT AS Instant NOT NULL,
    audioFileName TEXT NOT NULL,
    transcription TEXT NOT NULL,
    correctedText TEXT NOT NULL,
    summary TEXT NOT NULL
);

selectAll:
SELECT *
FROM Entry;

insert:
INSERT INTO Entry(timestamp, audioFileName, transcription, correctedText, summary)
VALUES (?, ?, ?, ?, ?);
The file validates just fine, a data class is being generated and the methods show up for me. However when I execute any of them, I get the following error (on Android):
Copy code
android.database.sqlite.SQLiteException: no such table: Entry (code 1 SQLITE_ERROR): , while compiling: SELECT *
                                                                                                    FROM Entry
It seems like the CREATE TABLE instruction at the top is not being executed. Any ideas why this is happening?
p
Do you see this error when you install fresh (and the DB has to be created from scratch)? If you have an existing database file, you probably need a corresponding migration that adds the new table and increments the schema version.