0

So I'm trying to set up sqldelight for my Compose Desktop project I created using IntelliJ's wizard. The generated project has its source code in ./src/JvmMain. As it is a Desktop only project, there is no expected/actual setup with platform-specific source directories, it's just jvmMain.

Out of the box sqldelight set up following the guide here doesn't find my .sq files. I assume because it either looks for main or commonMain (for multiplatform).

I can force it to look into jvmMain by configuring it like this:

sqldelight {
    databases {
        create("Database") {
            packageName.set("com.example.myproject.db")
            // manually setting the srcDir works
            srcDirs.setFrom("src/jvmMain/sqldelight")
        }
    }
}

This way it does generate my database code. But the generated code ends up in commonMain, which is created by sqldelight, since it didn't exist in the project. How can I change the location of the generated code?

michpohl
  • 852
  • 8
  • 30

0 Answers0