Tech
02/23/2024, 3:37 AMRETURNING *
syntax because of the autogen.
sqldelight {
databases {
create("Database") {
packageName.set("com.test")
deriveSchemaFromMigrations = true
dialect("app.cash.sqldelight:postgresql-dialect:2.0.1")
}
}
}
I define my table creations in the migrations
folder so as time goes on I just run all the migrations to get my table and then I define all my queries in the standard com.test
path.
The problem comes when I try to do something like
testQuery:
UPDATE SET Test WHERE id = :id RETURNING *
In the autogenerated code it fails to resolve the class Test
because that data class is being generated in the migrations
folder instead of com.test
.
Is there any way to fix this issue?Tech
02/23/2024, 3:55 AMgetAll:
SELECT * FROM Test;
Will automatically resolve the class by doing migrations.Test
as the return in the Kotlin generated code.
But using RETURNING *
doesn't mimic this.griffio
02/23/2024, 9:09 AM2.1.0-SNAPSHOT
Issue: https://github.com/cashapp/sqldelight/issues/4448 was fixed in current snapshot after 2.0.1
was released
Configure build for using snapshot: https://cashapp.github.io/sqldelight/2.0.1/#snapshotsTech
02/23/2024, 1:30 PM2.1.0-SNAPSHOT
be stable in production though?griffio
02/23/2024, 3:12 PM2.0.1
in production, then the snapshot should be ok too
Also, there are some more fixes for PostgreSql Dialect in the snapshot - see https://github.com/griffio/sqldelight-postgres-01
I don’t know when the next version of SqlDelight will be released as that would be the current snapshot anywayTech
02/23/2024, 3:16 PM