gradlebuild.gradlekotlin-multiplatformsqldelight

Wrong import of sqldelight in a generated dao file for queries


I am trying to set up sqldelight in my kmp-project.

I created a DatabaseDriverFactory:

expect class DatabaseDriverFactory {
    fun createDriver(): SqlDriver
}

I created my table:

CREATE TABLE ProjectList 
(
    id INTEGER NOT NULL PRIMARY KEY,
    project_name TEXT NOT NULL,
    path TEXT,
    start_date TEXT,
    start_time TEXT,
    last_change TEXT,
    single_species_with_attributes TEXT,
    plot_design TEXT,
    standard_species_design TEXT
);

selectAll:

SELECT * FROM ProjectList;

insertProject:

INSERT INTO ProjectList (
    id, project_name, path, start_date, start_time, last_change, single_species_with_attributes, plot_design, standard_species_design
) 
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?);

When I build the project, the generated ProjectListQueries.kt file imports import app.cash.sqldelight.driver.jdbc.JdbcCursor and import app.cash.sqldelight.driver.jdbc.JdbcPreparedStatement which is not found.

In my build.gradle.kts in the common main I imported sqldelight runtime and sqldelight coroutines v 2.0.2 from app.cash.sqldelight.

Does somebody know where the error could be located?

If further information are needed feel free to ask.


Solution

  • I removed the postgresql dialect, than it worked