https://kotlinlang.org logo
#squarelibraries
Title
# squarelibraries
s

Saiedmomen

06/25/2022, 9:12 AM
I'm trying out the mysql dialect of sqldelight and I see that tables aren't created in initial run.
Copy code
java.sql.SQLSyntaxErrorException: Table 'backend_db.record' doesn't exist
Copy code
CREATE TABLE record(
    date_time TEXT NOT NULL,
    value INTEGER NOT NULL
);

insert:
INSERT INTO record (date_time, value) VALUES (?, ?);

selectRecords:
SELECT * FROM record;
Is it expected behavior or am I missing sth in my setup?
Copy code
val hikariConfig: HikariConfig = HikariConfig("/hikari.properties").apply {
    validate()
}
val hikariDataSource: DataSource = HikariDataSource(hikariConfig)
val driver: SqlDriver = hikariDataSource.asJdbcDriver()
val db = Database(driver)
Also if it is expected behavior, what is the tool to use to initialize the db based on schema?
10 Views