Database
🧩 Database Explorer & SQL Editor
Flocon gives you direct access to your app’s local databases (SQLite, Room, SQLDelight, etc.), with a clean interface for exploring schemas and querying data.
Key capabilities include:
- Automatic detection of all SQLite databases on Android.
- Listing all tables and their schemas.
- Running custom SQL queries with syntax highlighting.
- Auto-updating queries and saving favorites.
- Generating INSERT and DELETE queries automatically.
Android (Automatic Detection)
On Android, Flocon automatically scans your app's internal storage and lists all SQLite databases. You don't need additional configuration to see them in the desktop app.
Manual Registration (Android)
If you want to use a custom display name or register an in-memory database, you can use floconRegisterDatabase:
// Register an In-Memory Room Database
val dogDatabase = Room.inMemoryDatabaseBuilder(context, DogDatabase::class.java).build()
floconRegisterDatabase(
displayName = "In-Memory Dogs",
openHelper = dogDatabase.openHelper
)
Multiplatform (Desktop & iOS)
For Kotlin Multiplatform projects (Desktop and iOS), you must provide the absolute path to the database file:
// On Desktop
val dbFile = File(System.getProperty("java.io.tmpdir"), "app_database.db")
floconRegisterDatabase(
displayName = "App DB",
absolutePath = dbFile.absolutePath,
)
// On iOS
val dbPath = "${documentDirectory()}/app_database.db"
floconRegisterDatabase(
displayName = "App DB",
absolutePath = dbPath
)
Database Query Logging
Flocon can also track and display all SQL queries executed by your app in real-time. This is particularly useful for debugging transactions, performance issues, or verifying the exact SQL generated by ORMs like Room.
Room Integration
For Room databases, you can easily log all queries by using the setQueryCallback method when building your database:
val dbName = "dogs_database"
val database = Room.databaseBuilder(
context.applicationContext,
DogDatabase::class.java,
dbName
).setQueryCallback({ sqlQuery, bindArgs ->
// Log the query to Flocon
floconLogDatabaseQuery(
dbName = dbName,
sqlQuery = sqlQuery,
bindArgs = bindArgs
)
}, Executors.newSingleThreadExecutor())
.build()
Manual Logging
If you are not using Room or want to log queries manually, you can use the floconLogDatabaseQuery function directly:
floconLogDatabaseQuery(
dbName = "my_custom_db",
sqlQuery = "SELECT * FROM users WHERE id = ?",
bindArgs = listOf(42)
)
SQL Workspace
The Flocon Desktop app provides a full SQL workspace where you can: 1. Explore: See all tables and their columns. 2. Query: Write any SQL query and see the results in a formatted table. 3. Favorites: Save your most used queries for quick access later. 4. Toolbox: Quickly generate common SQL statements from the UI.