mirror of
https://github.com/openflocon/Flocon.git
synced 2026-05-07 14:19:49 +00:00
63 lines
No EOL
2.2 KiB
Markdown
63 lines
No EOL
2.2 KiB
Markdown
### 🧩 Database Explorer & SQL Editor
|
||
|
||
<img width="1726" height="1080" alt="Screenshot 2025-10-14 at 23 40 58" src="https://github.com/user-attachments/assets/47360e06-43af-4713-b0ed-a6728a6b49ad" />
|
||
<img width="1728" height="1077" alt="Screenshot 2025-10-14 at 23 44 16" src="https://github.com/user-attachments/assets/f351970f-0511-4b54-af5e-55dcd209f2e2" />
|
||
|
||
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`:
|
||
|
||
```kotlin
|
||
// 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:
|
||
|
||
```kotlin
|
||
// On Desktop
|
||
val dbFile = File(System.getProperty("java.io.tmpdir"), "app_database.db")
|
||
|
||
floconRegisterDatabase(
|
||
displayName = "App DB",
|
||
absolutePath = dbFile.absolutePath,
|
||
)
|
||
```
|
||
|
||
```kotlin
|
||
// On iOS
|
||
val dbPath = "${documentDirectory()}/app_database.db"
|
||
|
||
floconRegisterDatabase(
|
||
displayName = "App DB",
|
||
absolutePath = dbPath
|
||
)
|
||
```
|
||
|
||
#### 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. |