# sqldelight

Published articles for sqldelight.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Under the Hood: How Room 3.0 and SQLDelight 2.x Detect Database Changes

DevFeed: [Under the Hood: How Room 3.0 and SQLDelight 2.x Detect Database Changes](<https://devfeed.tech/articles/under-the-hood-how-room-3-0-and-sqldelight-2-x-detect-database-changes-107102.md>)

Original publisher: [Read original article](<https://proandroiddev.com/under-the-hood-how-room-3-0-and-sqldelight-2-x-detect-database-changes-51e7a9b716dc?source=rss----c72404660798---4>)

Author: chanzmao

Published: 2026-10-29T17:35:32Z

Content type: comparison

Language: en

Sources: [ProAndroidDev](<https://devfeed.tech/sources/proandroiddev-medium.md>)

Topics: [sqldelight](<https://devfeed.tech/topics/sqldelight.md>), [Query (disambiguation)](<https://devfeed.tech/topics/query.md>)

Tags: [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [android-development](<https://devfeed.tech/tags/android-development.md>), [changes](<https://devfeed.tech/tags/changes.md>), [database](<https://devfeed.tech/tags/database.md>), [flow](<https://devfeed.tech/tags/flow.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>), [mobile-app-development](<https://devfeed.tech/tags/mobile-app-development.md>), [notifications](<https://devfeed.tech/tags/notifications.md>), [query](<https://devfeed.tech/tags/query.md>), [room](<https://devfeed.tech/tags/room.md>), [software-architecture](<https://devfeed.tech/tags/software-architecture.md>), [sqldelight](<https://devfeed.tech/tags/sqldelight.md>), [tables](<https://devfeed.tech/tags/tables.md>)

### AI overview

Room 3.0 observes table invalidations: its Flow runs the query when collection starts, then reruns it after a relevant table change. This can rerun a query even when its result is unchanged; cancellation stops the observation. SQLDelight 2.x attaches a listener to a Query. `Query.asFlow()` emits the query as a notification, while downstream operators such as `mapToList()` execute SQL and fetch rows; listener cleanup occurs when collection closes or is cancelled. Neither mechanism avoids reading from the database after a relevant notification. The text cautions that SQLDelight's query-level listener does not guarantee fewer executions or prove that only affected queries are notified; behavior depends on notification and driver implementation details.

### Source excerpt

Room and SQLDelight both let us observe database queries as Kotlin Flows. When the underlying data changes, the Flow emits an update, allowing the UI to react without manually refreshing the data. Image created by AI The result looks similar from the outside, but the two libraries handle change notifications differently. Room relies on InvalidationTracker to monitor database tables. SQLDelight uses listeners attached to individual Query objects. Let's look at how these mechanisms work internally and what the differences mean in practice. How Room 3.0 Monitors Database Changes Room uses InvalidationTracker to keep track of changes to database tables. When a DAO query returns a Flow, Room uses this mechanism to determine when the query should run again. The important detail is that Room tracks which tables a query depends on, rather than tracking changes to the query result itself. What happens behind the scenes? The following example illustrates the basic idea. It is simplified pseudocode, not Room's actual implementation. fun <T> createRoomQueryFlow( tracker: InvalidationTracker, tables: Array<String>, queryBlock: suspend () -> T ): Flow<T> = flow { emit(queryBlock()) tracker.createFlow(*tables).collect { emit(queryBlock()) } } There are two things worth noting here. The query runs before change monitoring begins. When collection starts, queryBlock() fetches the current data and emits the result. The Flow then observes invalidation events from InvalidationTracker. A table change can trigger another query execution. Suppose a query reads from the users table. When Room detects a relevant change to that table, the Flow can emit another result by executing the query again. Room does not need to compare the old and new query results. It uses table invalidation as a signal that the result may have changed. This approach keeps the mechanism straightforward, but it has a trade-off: a change to a table can trigger re-execution even when the actual result of a particular que

## Parallelism with Android SQLite

DevFeed: [Parallelism with Android SQLite](<https://devfeed.tech/articles/parallelism-with-android-sqlite-25628.md>)

Original publisher: [Read original article](<https://blog.p-y.wtf/parallelism-with-android-sqlite>)

Author: Pierre-Yves Ricau

Published: 2025-02-05T05:35:36Z

Content type: article

Language: en

Sources: [Py's blog](<https://devfeed.tech/sources/py-s-blog.md>)

Topics: [SQLite](<https://devfeed.tech/topics/sqlite.md>), [Parallelism](<https://devfeed.tech/topics/parallelism.md>), [Android](<https://devfeed.tech/topics/android.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [application](<https://devfeed.tech/tags/application.md>), [blocking](<https://devfeed.tech/tags/blocking.md>), [connection-pool](<https://devfeed.tech/tags/connection-pool.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [database](<https://devfeed.tech/tags/database.md>), [dispatcher](<https://devfeed.tech/tags/dispatcher.md>), [documentation](<https://devfeed.tech/tags/documentation.md>), [internals](<https://devfeed.tech/tags/internals.md>), [io](<https://devfeed.tech/tags/io.md>), [kdoc](<https://devfeed.tech/tags/kdoc.md>), [lock](<https://devfeed.tech/tags/lock.md>), [parallel](<https://devfeed.tech/tags/parallel.md>), [parallelism](<https://devfeed.tech/tags/parallelism.md>), [performance](<https://devfeed.tech/tags/performance.md>), [point-of-sale](<https://devfeed.tech/tags/point-of-sale.md>), [pool](<https://devfeed.tech/tags/pool.md>), [queries](<https://devfeed.tech/tags/queries.md>), [query](<https://devfeed.tech/tags/query.md>), [sqldelight](<https://devfeed.tech/tags/sqldelight.md>), [sqlite](<https://devfeed.tech/tags/sqlite.md>), [square](<https://devfeed.tech/tags/square.md>)

### AI overview

Android SQLite may allow only one connection per database, so parallel queries against the same database can occupy multiple coroutine threads while waiting on that connection. The excerpt warns that enough blocked queries can consume most of the IO dispatcher's 64 threads and delay unrelated IO work. It describes the practical approach of using a distinct dispatcher instance for each database, drawing on the elasticity of limited-parallelism dispatcher views. The excerpt ends mid-explanation, so it does not provide the complete configuration or implementation.

### Source excerpt

The SQLDelight documentation provides this example: val players: Flow> = playerQueries.selectAll() .asFlow() .mapToList(Dispatchers.IO) This looks reasonable, right? In the Square Point Of Sale application, we recently ...

## SQLDelight 2.0.1 fixes a Kotlin/Native thread-safety bug

DevFeed: [SQLDelight 2.0.1 fixes a Kotlin/Native thread-safety bug](<https://devfeed.tech/articles/sqldelight-2-0-1-includes-big-fix-for-kotlin-native-jigar-brahmbhatt-38144.md>)

Original publisher: [Read original article](<https://touchlab.co/2023-12-21-upgrade-to-sqldelight-201>)

Published: 2023-12-21T02:05:15Z

Content type: release

Language: en

Sources: [Touchlab](<https://devfeed.tech/sources/touchlab-enterprise-mobile-innovation-development.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [bug](<https://devfeed.tech/topics/bug.md>), [releases](<https://devfeed.tech/topics/releases.md>)

Tags: [bug](<https://devfeed.tech/tags/bug.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [kotlin-native](<https://devfeed.tech/tags/kotlin-native.md>), [release](<https://devfeed.tech/tags/release.md>), [sqldelight](<https://devfeed.tech/tags/sqldelight.md>)

### AI overview

SQLDelight 2.0.1 includes a fix for a Kotlin/Native thread-safety bug related to concurrent database operations, along with other fixes. The article recommends upgrading to the new version.

### Source excerpt

The 2.0.1 update for SQLDelight is out now and features a crucial bug fix addressing thread safety issues in Kotlin Native.

## Moving forward with the Kodein Open Source Initiative

DevFeed: [Moving forward with the Kodein Open Source Initiative](<https://devfeed.tech/articles/moving-forward-with-the-kodein-open-source-initiative-22864.md>)

Original publisher: [Read original article](<https://medium.com/kodein-koders/moving-forward-with-the-kodein-open-source-initiative-9fc4f6160c84?source=rss----f311f45ef54---4>)

Author: Salomon BRYS

Published: 2022-06-08T12:53:24Z

Content type: news

Language: en

Sources: [Kodein Koders](<https://devfeed.tech/sources/kodein-koders-medium.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>), [open source maintenance](<https://devfeed.tech/topics/open-source-maintenance.md>), [Dependency injection](<https://devfeed.tech/topics/dependency-injection.md>), [software-development](<https://devfeed.tech/topics/software-development.md>)

Tags: [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [framework](<https://devfeed.tech/tags/framework.md>), [initiative](<https://devfeed.tech/tags/initiative.md>), [kodein](<https://devfeed.tech/tags/kodein.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [libraries](<https://devfeed.tech/tags/libraries.md>), [logging](<https://devfeed.tech/tags/logging.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [source](<https://devfeed.tech/tags/source.md>), [sqldelight](<https://devfeed.tech/tags/sqldelight.md>)

### AI overview

Kodein Koders will sunset Kodein-Framework and maintain its open-source libraries under the Kodein Open Source Initiative (KOSI), giving each library an independent identity. The founders say presenting the libraries as parts of an unfinished framework made their value harder to assess and could suggest that developers should use the whole suite. KOSI is intended to let developers choose components on their own merits--for example, using KODEIN Dependency Injection with SQLDelight rather than Kodein-DB. The excerpt says the GitHub organization and projects will move and be renamed in the following weeks, and that KODEIN-DI will revert to the name KODEIN. The article frames its outlook for Kotlin Multiplatform development as a multi-year vision; the supplied text ends before describing that vision in detail.

### Source excerpt

Photo by Daniel Lerman on Unsplash Back in the very early days of Kotlin Multiplatform, when the KODEIN Dependency Injection library was the very first community library ever being ported to this new promising technology, I dreamt of an integrated suite of components that, together, offered mobile developers tools to quickly and easily develop multi-platform mobile applications. In essence, I wanted to create a framework providing DI, DB, Logging, MVI, and more, all integrated into a cohesive platform. However, as time went on, I realised that Open Source development is quite long and difficult (who knew, right?), especially when you're a team of two, and that you also need to work for clients, in order to, you know, eat. I also realised that I was promoting our work backwards. The message "This lib is part of a framework that does not really exist yet, but it is also its own independent library that you can totally use without any other of our libs" is actually very ambiguous. Furthermore, full fledged frameworks are nowadays a lot less attractive to developers. As application craftsmen & craftswomen, we want to own our architecture, and make choices that reflect our very own business needs, opinions, and experience. It's not because you are using the Kodein Dependency Injection container that using SQLDelight (instead of Kodein-DB) should feel a mistake, or vice-versa. I came to the realisation that when we advertise each library as part of a whole framework, we harm each individual library by preventing them to be evaluated only by their own merits. We (Romain and I, founders of Kodein Koders) decided that it is time to sunset the Kodein-Framework. This by no means signifies that we will stop working on our Open-Source libs, but simply that each library will be given its very own independent identity. We will be maintaining & advancing these libraries as the "Kodein Open Source Initiative", or KOSI for short. The biggest change that this decision will bring is th

## SQLDelight on the Server

DevFeed: [SQLDelight on the Server](<https://devfeed.tech/articles/sqldelight-on-the-server-30599.md>)

Original publisher: [Read original article](<https://ryanharter.com/blog/2020/08/sqldelight-on-the-server/>)

Published: 2020-08-27T16:05:00Z

Content type: article

Language: en

Sources: [Blogs on Ryan Harter](<https://devfeed.tech/sources/blogs-on-ryan-harter.md>)

Topics: [Object-relational mapping](<https://devfeed.tech/topics/orm.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [MySQL](<https://devfeed.tech/topics/mysql.md>), [Database](<https://devfeed.tech/topics/database.md>), [API](<https://devfeed.tech/topics/api.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [api](<https://devfeed.tech/tags/api.md>), [mariadb](<https://devfeed.tech/tags/mariadb.md>), [mysql](<https://devfeed.tech/tags/mysql.md>), [orm](<https://devfeed.tech/tags/orm.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [sql](<https://devfeed.tech/tags/sql.md>), [sqldelight](<https://devfeed.tech/tags/sqldelight.md>)

### AI overview

The article explains how SQLDelight evolved from an Android ORM into a multiplatform database access tool that supports server-grade dialects such as MySQL, MariaDB, PostgreSQL, and H2. It also describes using SQLDelight with MySQL in a currency conversion API called Gringotts.

### Source excerpt

I've used Cashapp's SQLDelight for years in my Android apps. Unlike other ORM libraries, which create an abstraction that allows you to access databases in native code and generates the SQL to access the data for you, SQLDelight embraces SQL as a first class language, recognizing it's optimizations for defining and querying data, and allows you to write queries and data definitions and generates consuming code based on those. Over the last few years SQLDelight has been transformed from a nice Android ORM that integrates nicely with AutoValue into a mutliplatform option to access and manage your data without having to learn another query abstraction.

## Multiplatform Encryption with SQLDelight and SQLCipher - Samuel Hill

DevFeed: [Multiplatform Encryption with SQLDelight and SQLCipher - Samuel Hill](<https://devfeed.tech/articles/multiplatform-encryption-with-sqldelight-and-sqlcipher-samuel-hill-38299.md>)

Original publisher: [Read original article](<https://touchlab.co/multiplatform-encryption-with-sqldelight-and-sqlcipher>)

Published: 2020-07-14T14:11:43Z

Content type: tutorial

Language: en

Sources: [Touchlab](<https://devfeed.tech/sources/touchlab-enterprise-mobile-innovation-development.md>)

Topics: [Encryption](<https://devfeed.tech/topics/encryption.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [multiplatform](<https://devfeed.tech/topics/multiplatform.md>), [SQLite](<https://devfeed.tech/topics/sqlite.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [code-sharing](<https://devfeed.tech/tags/code-sharing.md>), [encryption](<https://devfeed.tech/tags/encryption.md>), [ios](<https://devfeed.tech/tags/ios.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [kotlin-native](<https://devfeed.tech/tags/kotlin-native.md>), [multiplatform](<https://devfeed.tech/tags/multiplatform.md>), [sqldelight](<https://devfeed.tech/tags/sqldelight.md>), [sqlite](<https://devfeed.tech/tags/sqlite.md>), [thoughts](<https://devfeed.tech/tags/thoughts.md>)

### AI overview

The article explains integrating SQLCipher encryption into a Kotlin/Native and Kotlin Multiplatform project using SQLDelight. It describes how SQLDelight's linkSqlite setting can cause vanilla SQLite3 to be linked, and warns that undocumented encryption behavior in iOS's SQLite build should not be mistaken for intentional SQLCipher usage.

### Source excerpt

Last year we received a PR to SQLiter (The Kotlin/Native driver that Touchlab maintains for SQLDelight) which laid the groundwork for handling encryption of our SQLite databases. Recently, Kevin Schildhorn and I have been working on taking the next step of introducing an encryption library in our Kotlin/Native build, specifically, SQLCipher. The first wrinkle we ran in to was that vanilla SQLite3 seemed to be getting linked automatically which made ensuring SQLCipher gets used tricky.

## Supporting Multiple Dialects in SQLDelight

DevFeed: [Supporting Multiple Dialects in SQLDelight](<https://devfeed.tech/articles/supporting-multiple-dialects-in-sqldelight-25527.md>)

Original publisher: [Read original article](<https://aleckazakova.com/posts/multiple-dialects/>)

Author: Author

Published: 2020-02-13T18:15:17Z

Content type: article

Language: en

Sources: [Posts on AlecStrong](<https://devfeed.tech/sources/posts-on-alecstrong.md>)

Topics: [SQLite](<https://devfeed.tech/topics/sqlite.md>), [MySQL](<https://devfeed.tech/topics/mysql.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [Parsing](<https://devfeed.tech/topics/parsing.md>), [ANTLR](<https://devfeed.tech/topics/antlr.md>)

Tags: [compiler](<https://devfeed.tech/tags/compiler.md>), [compilers](<https://devfeed.tech/tags/compilers.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [intellij](<https://devfeed.tech/tags/intellij.md>), [lexer](<https://devfeed.tech/tags/lexer.md>), [mysql](<https://devfeed.tech/tags/mysql.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [parsing](<https://devfeed.tech/tags/parsing.md>), [plugin](<https://devfeed.tech/tags/plugin.md>), [python](<https://devfeed.tech/tags/python.md>), [sql](<https://devfeed.tech/tags/sql.md>), [sqldelight](<https://devfeed.tech/tags/sqldelight.md>), [sqlite](<https://devfeed.tech/tags/sqlite.md>)

### AI overview

This article explains how SQLDelight supports multiple SQL dialects, including SQLite 3.18, SQLite 3.24, and MySQL. It describes the compiler, lexer, parser, AST, and the use of JetBrains Grammar Kit to build composable parsing and incrementally extend dialect support.

### Source excerpt

With SQLDelight 1.3.0 and above we now support multiple dialects of SQL (at time of writing: SQLite 3.18, SQLite 3.24, and MySQL). They're not complete implementations of any of those dialects but they support necessary features and the real meat of the release is a straightforward framework for adding parts of the dialects incrementally. For example, SQLite 3.24 is just SQLite 3.18 with upsert on top (thank you Angus Holder!).

## Kotlin Multiplatform Library - Touchlab

DevFeed: [Kotlin Multiplatform Library - Touchlab](<https://devfeed.tech/articles/kotlin-multiplatform-library-touchlab-38269.md>)

Original publisher: [Read original article](<https://touchlab.co/kotlin-multiplatform-library>)

Published: 2019-11-19T22:31:00Z

Content type: tutorial

Language: en

Sources: [Touchlab](<https://devfeed.tech/sources/touchlab-enterprise-mobile-innovation-development.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Library](<https://devfeed.tech/topics/library.md>), [cross-platform](<https://devfeed.tech/topics/cross-platform.md>)

Tags: [code-sharing](<https://devfeed.tech/tags/code-sharing.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [cross-platform](<https://devfeed.tech/tags/cross-platform.md>), [kmp](<https://devfeed.tech/tags/kmp.md>), [koin](<https://devfeed.tech/tags/koin.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [kotlin-multiplatform-libraries](<https://devfeed.tech/tags/kotlin-multiplatform-libraries.md>), [ktor](<https://devfeed.tech/tags/ktor.md>), [library](<https://devfeed.tech/tags/library.md>), [sqldelight](<https://devfeed.tech/tags/sqldelight.md>), [sqlite](<https://devfeed.tech/tags/sqlite.md>), [thoughts](<https://devfeed.tech/tags/thoughts.md>)

### AI overview

Touchlab provides an overview of Kotlin Multiplatform libraries, listing libraries used by Touchlab, JetBrains, and the community, along with sample apps and a presentation on Kotlin Multiplatform library development.

### Source excerpt

Introduction to Kotlin Multiplatform explains how KMP is pragmatic programming to develop apps on multiple platforms & avoid writing code twice.

## SQLite/SQLDelight ❤ Kotlin Multiplatform - Kevin Galligan

DevFeed: [SQLite/SQLDelight ❤ Kotlin Multiplatform - Kevin Galligan](<https://devfeed.tech/articles/sqlite-sqldelight-kotlin-multiplatform-kevin-galligan-38321.md>)

Original publisher: [Read original article](<https://touchlab.co/sqlite-sqldelight-kotlin-multiplatform>)

Published: 2018-05-04T18:52:53Z

Content type: article

Language: en

Sources: [Touchlab](<https://devfeed.tech/sources/touchlab-enterprise-mobile-innovation-development.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Mobile](<https://devfeed.tech/topics/mobile.md>), [Database](<https://devfeed.tech/topics/database.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [built-by-touchlab](<https://devfeed.tech/tags/built-by-touchlab.md>), [code-sharing](<https://devfeed.tech/tags/code-sharing.md>), [cross-platform](<https://devfeed.tech/tags/cross-platform.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [kotlin-native](<https://devfeed.tech/tags/kotlin-native.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [multiplatform](<https://devfeed.tech/tags/multiplatform.md>), [press](<https://devfeed.tech/tags/press.md>), [sql](<https://devfeed.tech/tags/sql.md>), [sqldelight](<https://devfeed.tech/tags/sqldelight.md>), [sqlite](<https://devfeed.tech/tags/sqlite.md>), [testing](<https://devfeed.tech/tags/testing.md>), [thoughts](<https://devfeed.tech/tags/thoughts.md>)

### AI overview

The article discusses Kotlin Multiplatform development using Kotlin/Native, the need for shared libraries across Android and iOS, and running SQLDelight on iOS.

### Source excerpt

A few weeks back I posted a piece about Mobile Oriented Architecture and how I think coding products for screens will evolve. At the end, I said I was keeping an eye out for the Kotlin/Native multiplatform commit. I was. Really. Read the commit emails every morning. Yet somehow I missed the fact that multiplatform was possible. You can build multiplatform projects using Kotlin/Native. I won't say it's super productive yet, but you can do it.