Flocon/docs/database.md
Raphael Teyssandier 2c42d582e2 feat: Pages
2025-11-27 19:33:22 +01:00

1.7 KiB
Raw Blame History

🧩 Database (kotlin multi platform compatible)

Screenshot 2025-10-14 at 23 40 58 Screenshot 2025-10-14 at 23 44 16

Flocon gives you direct access to your apps local databases (SQLite, Room, etc.), with a clean interface for exploring and querying data.

Features include:

  • Listing all available databases
  • Display all database tables & schemas
  • Running custom SQL queries in tabs
  • Auto update queries
  • Save queries as favorite
  • Generate Insert & Delete queries

This makes it easy to debug persistent storage issues, verify migrations, or test app behavior with specific data sets — all without leaving your IDE.

On android there's nothing to add, but on a multi platform project, you need to provide the database's path to flocon

// on a desktop project
val dbFile = File(System.getProperty("java.io.tmpdir"), "flocon_food_database.db")

floconRegisterDatabase(
    displayName = "food",
    absolutePath = dbFile.absolutePath,
)

return Room.databaseBuilder<FoodDatabase>(
        name = dbFile.absolutePath,
    )
    .setDriver(BundledSQLiteDriver())
    .setQueryCoroutineContext(Dispatchers.IO)
    .build()
// on an ios project
val dbFile = "${documentDirectory()}/dog_database.db"

floconRegisterDatabase(
    absolutePath = dbFile, 
    displayName = "Dog Database"
)

return Room.databaseBuilder<DogDatabase>(
        name = dbFile,
    )
    .setDriver(NativeSQLiteDriver())
    .build()