https://kotlinlang.org logo
Join Slack
Powered by
# squarelibraries
  • a

    Alex

    06/23/2025, 1:29 PM
    Hi all! I'm working on upgrading our Android project's SQLDelight version from 2.0.1 to 2.10, but seeing an issue compiling after upgrading where it does not recognize
    last_insert_rowid()
    Copy code
    Unknown function last_insert_rowid
        SELECT last_insert_rowid()
               ^^^^^^^^^^^^^^^^^^^
    last_insert_rowid()
    is a part of SQLite, is there some kind of change made to override this in the latest update? I was unable to find anything directly referencing it in the changelogs
    ➕ 1
    j
    • 2
    • 1
  • u

    ursus

    06/25/2025, 1:33 PM
    Does anvil not work with kotlin 2.2.0 for anyone else as well?
    👌 1
    s
    j
    • 3
    • 3
  • r

    Ryan Woodcock

    06/27/2025, 4:51 AM
    Is there any chance this issue with the sqldelight plugin will be looked at any time soon? Currently the plugin is constantly flashing and not providing syntax highlighting in intellij https://github.com/sqldelight/sqldelight/issues/5664
    ➕ 3
  • c

    Colton Idle

    06/29/2025, 2:38 PM
    This post by Dan Abramov https://overreacted.io/progressive-json/ is making me rethink how json is parsed/deserialized via okhttp. From what Dan says you can't deserialize json until its completely downloaded, but i always thought with okhttp + moshi (or whatever) that the deserialization happens while streaming the resopnse. i vaugley remember a droidcon talk where jake/jesse talked about amoritized cost of network response vs deserialization. and even the fact that json serializer benchmarks that use strings aren't really benchmarking the right thing. Can someone confirm if okhttp allows streaming of responses + streamed deserialization?
    j
    m
    j
    • 4
    • 14
  • j

    jessewilson

    06/29/2025, 5:06 PM
    I’m preparing OkHttp 5.0.0 and I’m looking for some community help. Can you please try out
    5.0.0-alpha.17
    in your projects and let me know if you run into any surprises? OkHttp 5.x introduces separate
    -jvm
    and
    -android
    artifacts. We’ve had reports (issue 8826) that some builds incorrectly classes from both a
    okhttp-android
    5.x artifact and a
    okhttp
    4.x artifact, which causes crashes at runtime. I haven’t been able to reproduce this. If you can repro this, please reply on thread; I’d love to get to the bottom of this. My intention is for 5.x to have zero backwards-incompatible changes with 4.12. If you see any, again please let me know.
    e
    t
    +2
    • 5
    • 17
  • z

    Zoltan Demant

    07/04/2025, 4:17 AM
    Im looking into a potential race condition with SqlDelight:
    Copy code
    private val database by lazy {
        scope.async { init() }
    }
    
    suspend fun database() = database.await()
    The
    suspend fun init()
    function creates the actual database and makes sure some template data is inserted the first time around. The whole point is that this happens before other areas of my app can touch the database. Ive been doing this for years and it has worked brilliantly, but recently something seems to have changed: under some scenario, the database is accessed before the template data is inserted. Ill add some more details in 🧵 in order to keep this somewhat short.
    e
    • 2
    • 41
  • v

    Vivek Modi

    07/09/2025, 10:41 PM
    Hey guys, I'm using the square wire client library on the kmm + cmp project. When I use the wire client library in the commonMain it gives me an error on wasmJs. Could any one can help with this?
    j
    b
    • 3
    • 8
  • m

    Mark

    07/10/2025, 6:58 AM
    In sqldelight, when making raw queries, how to ensure identifiers do not conflict with generated query identifiers? Is there a range etc?
    h
    • 2
    • 4
  • a

    Adam S

    07/10/2025, 7:28 AM
    SQLDelight question: is there a docs page that lists all of the valid built-in data types, and what Kotlin type they correspond to? E.g. TEXT = String
    • 1
    • 1
  • a

    Adam S

    07/11/2025, 10:20 AM
    SQLDelight question: The docs explain how to enable foreign keys for SQLite, but how are they actually defined in a
    .sq
    file? https://sqldelight.github.io/sqldelight/2.1.0/jvm_sqlite/foreign_keys/
    e
    • 2
    • 1
  • j

    Joel Wilcox

    07/18/2025, 12:18 AM
    Sharing an important Anvil update: We've decided to deprecate Anvil in favor of Metro. See Anvil Moves to Maintenance Mode for the full announcement + context, and please let us know if you have any questions or things that could use clarification
    😮 2
    🚇 7
    👍 7
    s
    • 2
    • 1
  • s

    shikhar

    07/23/2025, 3:11 AM
    Is there a way we can bundle custom sqlite build for android/iOS in SQLDelight? Please point me to some documentation/writeup that can help with setting it up Context: Used in a library that target js/ios/android where idb will be used for js and sqlite for iOS/android Cannot rely on sqlite provided by platform since I want a standardised version of sqlite for both targets
    e
    • 2
    • 7
  • k

    KamilH

    07/28/2025, 8:08 AM
    @jessewilson I’ve just watched your great talk at Droidcon (Coroutines Party Tricks) and I noticed that on the last slide, there is a link to the GitHub repo which leads to 404 🙂 https://github.com/swankjesse/coroutines-party-tricks/ Are you planning to open it? Also, I have a question about the coroutine-based navigation approach. Since in the Android world our Activity might be recreated at any point, how do we properly support “suspending results” in that case? As far as I know, the coroutine (or suspension point, I’m not sure what the appropriate name is here) cannot be serialized and placed on the Bundle, so how can we deliver the result of our screen to the point we need after our Activity is recreated?
    ✅ 1
    j
    • 2
    • 5
  • u

    ursus

    07/29/2025, 10:50 PM
    At droidcon the build panel folks talked about a cli tool to generate new module (structure, defaults etc). Is this a gradle job or would shell script be better suited or something else?
    j
    g
    e
    • 4
    • 30
  • s

    skominas.ainis

    08/01/2025, 8:34 AM
    How could I inspect SQLDelight database on iOS? I have a Compose Multiplatform project. With Android it is easy to use App Inspection or pull .db file via ADB, but how to do it on iOS?
  • k

    Kev

    08/03/2025, 8:20 AM
    Using SqDelight, how can i define 2 different migration folders where SqlDelight must look for when building my migrations and queries (this is the .sqm migrations - its generating the sql migrations fine although it comprises of all my migrations which is undesired)
    • 1
    • 1
  • c

    Colton Idle

    08/11/2025, 2:51 PM
    Maybe a dumb question. But im working on a library (regretfully 😂) and we need to make network calls. would love to use okhttp + kotlinx.serialization, but we don't want to go all in and pull in retrofit. Is there an "easy" way to deserialization with okhttp without brining in retrofit?
    m
    j
    • 3
    • 8
  • c

    Colton Idle

    08/11/2025, 3:12 PM
    Another fun one... This is weird right? We have a slim network layer (on top of okhttp) to just make a few things a bit easier. and we have a
    Copy code
    fun sendSync(req: Req): Res
    return runBlocking {
      sendAsync()
    }
    Copy code
    suspend fun sendAsync() {...}
    k
    g
    • 3
    • 16
  • u

    ursus

    08/11/2025, 3:25 PM
    With okhttp 5.1 my minified android build fails with
    Copy code
    > Task :foo:app:minifyTstStableReleaseWithR8 FAILED
    ERROR: Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in /Users/bar/AndroidStudioProjects/foo/app/build/outputs/mapping/tstStableRelease/missing_rules.txt.
    ERROR: R8: Missing class okhttp3.internal.Util (referenced from: void okhttp3.internal.sse.RealEventSource.processResponse(okhttp3.Response) and 1 other context)
    Anyone else experiencing this?
    c
    y
    • 3
    • 29
  • d

    Deep Patel

    08/16/2025, 4:19 AM
    Does anyone know if the workflow kt test library supports pure kotlin or multiplatform? I have an app built in multiplatform using workflow kt but can’t test it since last I checked the test library was only supported for the jvm target
    z
    b
    • 3
    • 20
  • c

    Colton Idle

    08/21/2025, 1:44 PM
    Trying to understand which parts of okhttp are "value classes" Struggling with whether or not https://square.github.io/okhttp/3.x/okhttp/okhttp3/Request.html is a value class because of it's description
    An HTTP request. Instances of this class are immutable if their body is null or itself immutable.
    Like if this was written in kotlin would it just be a data class?
    m
    j
    y
    • 4
    • 16
  • u

    ursus

    08/22/2025, 1:04 PM
    If
    turbine
    gurus could chime in
    Copy code
    private val _state = MutableStateFlow<ChatState>(ChatState.Idle)
    override val state: Flow<ChatState> get() = _state
    
    scope.launch {
        combine(
            conversationDao.conversation.doOnNext { println("-- CONVERSATION=$it") },
            connector.connectionState.doOnNext { println("-- CONN_STATE=$it") },
            ::stateMapper
        )
            .collect {
                println("--- PRODUCED=$it")
                _state.value = it
            }
    }
    I have
    combine
    which produces as a result and pipes it into stateflow
    _state
    . That
    state
    flow is then asserted at test time with turbine (ommited) Issue is that for some reason this is not deterministic. Default value of
    connectionState
    is
    Disconnected
    and then obviously
    Connecting etc
    What I'm seeing is that sometimes I see
    Connecting
    getting emitted before the product of combining with
    Disconnected
    gets set to the
    _state
    Othertimes it's not and I see 2 `--- PRODUCED`as expected. Is this a
    StateFlow
    issue? A
    combine
    issue? A Turbine issue? A
    TestDispatcher
    issue? Should I maybe not assert all the intermediary emits and just the last one using?
    c
    • 2
    • 6
  • a

    Alexander Ioffe

    08/29/2025, 8:55 PM
    Question for SqlDelight maintainers. Would you be willing to take a PR to either: 1. Expose
    sqliter.Cursor
    from SqliterSqlCursor,
    ResultSet
    from JdbcCursor, etc... or 2. Expose some kind of
    CursorMetadata
    API? I'm trying to see if I can integrate my libraries Terpal/ExoQuery with SQLDelight and the missing piece seems to be DB result-set metadata.
  • a

    andylamax

    08/31/2025, 9:32 AM
    Hi there, I am using SQLDelight and I am trying to setup a dependency between two database (defined with the sqldelight gradle plugin). I followed the documentation and it shows clearly how to do this on a gradle subproject. There are two ways to setup these kind of dependencies
    Copy code
    fun dependency(dependencyProject: Project)
    fun dependency(delegatedProject: DelegatingProjectDependency)
    The issue that I have here is that, the dependencies are defined inside a composite build (not just a subproject). And I am having a hard time getting an instance of that subproject. If anyone can help me how to achieve this, I will greatly appreciate
    h
    • 2
    • 6
  • s

    Shubham Singh

    08/31/2025, 2:14 PM
    Hi everyone, how do we create a persistent DB using SQLDelight on JS? Web Workers driver by default only creates an in-memory DB.
    a
    • 2
    • 1
  • a

    andylamax

    09/02/2025, 1:57 PM
    Hello once again, I am building a hybrid app (with both online and offline support) and I am trying an unorthodox approach of sharing some tables on the client side and the server side The issue is that I need to write an SQL statement that is portable between SQLite (on the client) and MySQL (on the backend) Take the following statement as an example
    Copy code
    CREATE TABLE IF NOT EXISTS ow_core_people(
        uid INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT,
        name TEXT NOT NULL,
        photo TEXT
    );
    Because AUTO_INCREMENT doesn't work on SQLite, it just works on MySQL but fails on SQLite. Is there a way for SQLDelight to support these multiple syntax and transform them in accordance to the dialect selected?
  • c

    Colton Idle

    09/07/2025, 4:58 AM
    did the compose dialogs library from keith ever ship or is that still coming up?
    s
    z
    +2
    • 5
    • 7
  • u

    ursus

    09/09/2025, 11:30 AM
    When writing
    sqldelight
    kotlin migrations, I need to have atleast a placeholder
    .sqm
    file. This is error prone, as nothing seems to enforce the
    .sqm
    file. Has anyone figured out a way to blow up such state? (
    .kt
    migration present but
    .sqm
    not)
  • s

    Slackbot

    09/10/2025, 10:32 AM
    This message was deleted.
    j
    a
    • 3
    • 2
  • e

    eygraber

    09/12/2025, 6:58 PM
    If anyone has a project using SqlDelight that could test it with sqldelight-androidx-driver it would be very much appreciated 😄 https://kotlinlang.slack.com/archives/C0BJ0GTE2/p1757703433402129
    ☝️ 1