Build Environment
SQLDelight version: 1.4.3
OS: MacOS Big Sur beta
Gradle version: 6.6-rc-6-all
Kotlin version: 1.4.0
Describe the bug
Generated code does use full qualifier names and this clashes with my database.* package.
I have my sq files in database/src/commonMain/sqldelight/database/*
Gradle configured as following
sqldelight {
database("Database") {
packageName = "database"
}
}
I've used this setup on SqlDelight 1.4.0 and 1.4.1 and there was no error as it was generating something like

But now it's generating something like:

that clashes with private val database: DatabaseImpl, while it should be as following, since the correct import is already there

the problem here is that the database part of database.movies.YearRangeWithRating is resolving to the type database instead of the package database?
No, we have private val database: DatabaseImpl as member of the class

So when tryin to resolve database as package name, it clashes with that property, so ye, I think full qualifier here is not needed and I wish to do not change my package name.
FYI: still ok until 1.4.2
@AlecStrong are you some kind of robot? 馃檭
haha i had a hunch what the fix would be, once thats merged try the snapshot and let me know if its still broken
Where is hosted the snapshot? Didn't find on the website
True the documentation for that is no longer on the site, I added that back here: https://github.com/cashapp/sqldelight/pull/1941
once the pull request to fix this issue is merged a snapshot will be published ~30min after that, then you can depend on it by doing
buildscript {
repositories {
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath "com.squareup.sqldelight:gradle-plugin:1.5.0-SNAPSHOT"
}
}
Thank you, I'll keep an eye on it!
I confirm to be solved

Just a note, don't wanna bother with a new issues, unless I should 馃檪 : probably is there temporally as is a snapshot version or maybe it is intentional, dunno about the policies, but there is an import from an internal pkg
import com.squareup.sqldelight.internal.copyOnWriteList
i think thats fine, its just intended to to say "this should only be used by sqldelight-generated code"
Intentional. For use by generated code only.

rekt
@AlecStrong will KotlinPoet use the FQN if needed (like with this issue https://github.com/cashapp/sqldelight/issues/1925)? If so, I think there will still be a problem if #1925 and #1939 both occur. One potential workaround is to mangle the property names in generated classes.
yes, it will use the FQN if there is a collision
Most helpful comment
rekt