Skip to content

feat: [DATABASE] Room 3 query logs through a logging SQLite driver - #743

Merged
florent37 merged 3 commits into
fix/database-logs-by-idfrom
feat/room3-query-logs
Oct 30, 2026
Merged

florent37 merged 3 commits into
fix/database-logs-by-idfrom
feat/room3-query-logs

Conversation

@florent37

Copy link
Copy Markdown
Contributor

Description

Room 3 has no setQueryCallback, so its databases never sent their queries to Flocon: the Logs screen was empty for every Room 3 database (only the Room 2 one of the sample logged). This adds SQLiteDriver.floconLogs(id), which wraps the driver given to setDriver(...) and logs each statement when it runs, with its arguments.

Stacked on #742 (the id is the one the database is registered with): this PR targets fix/database-logs-by-id so its diff is only the Room 3 part. Retarget it to main once #742 is merged.

  • SDK: floconLogs(id) in database:room3 (common expect, one implementation for Android / JVM / iOS and one suspend implementation for Wasm, where the driver methods are suspend), no-op in database:room3-no-op.
  • Samples: the Room 3 databases of the Android multiplatform, desktop JVM, iOS and Wasm samples use it, with the id they are registered with.
  • Docs: Room 3 tab in docs2/database.md.

Tested: :database:room3:jvmTest (4 tests on the wrapper with a fake driver), compilation of room3 and room3-no-op on Android / JVM / iOS / Wasm, of the four samples, and debug + release builds of :sample:android. Checked on the Android emulator with AndroidSQLiteDriver: inserting a dog shows the INSERT INTO DogEntity with its arguments in list_database_query_logs for dogs_room3. The JVM, iOS and Wasm drivers are compiled but not run.

/gemini review

@florent37
florent37 marked this pull request as ready for review October 30, 2026 22:40
@florent37
florent37 merged commit 7bacf69 into fix/database-logs-by-id Oct 30, 2026
@florent37
florent37 deleted the feat/room3-query-logs branch October 30, 2026 22:41
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

Successfully merging this pull request may close these issues.

1 participant