Skip to content

[ksp2][room] [ksp] [SQLITE_ERROR] SQL error or missing database (near ")": syntax error) #2469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
virogu opened this issue May 22, 2025 · 0 comments

Comments

@virogu
Copy link

virogu commented May 22, 2025

room = "2.7.1"
kotlin = "2.1.21"
ksp = "2.1.21-2.0.1" // and "2.1.20-2.0.1"

After upgrading to KSP2, Room compilation failed with the following error:
[ksp] [SQLITE_ERROR] SQL error or missing database (near ")": syntax error).

Investigation revealed that the properties of inner classes were being completely removed during code generation.

For example:

@Serializable
class A {
    //Error while "kspDebugKotlin"
    @Serializable
    @Entity(tableName = "tab_a")
    class AA(
        @ColumnInfo(name = "colum1")
        val colum1: String,
        @ColumnInfo(name = "colum2")
        val colum2: String,
        @ColumnInfo(name = "colum3")
        val colum3: String,
    )
}

//This is ok
@Serializable
@Entity(tableName = "tab_b")
data class BB(
    @ColumnInfo(name = "colum1")
    val colum1: String,
    @ColumnInfo(name = "colum2")
    val colum2: String,
    @ColumnInfo(name = "colum3")
    val colum3: String,
)

Looking at the createSql in the schemas json file, table tab_a has no fields, while table tab_b is normal.
All properties of class AA are also missing during compilation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant