Skip to content

Commit a4194a6

Browse files
authored
feat(seed): embedded LibreDB sample connection on first standalone startup (#97)
On first standalone startup, Studio auto-provisions an editable, dismissable 'Sample (LibreDB)' connection seeded with example data across all three lenses (relational table, document collection, raw key-value). Gated by LIBREDB_EMBEDDED_SAMPLE (default on); never appears in embedded/platform mode. Includes a general dismissed-seeds mechanism so a deleted sample stays gone.
1 parent af061f9 commit a4194a6

20 files changed

Lines changed: 1186 additions & 6 deletions

.env.example

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,14 @@ LLM_MODEL=gemini-2.5-flash
152152
# LLM_MODEL=local-model
153153
# LLM_API_URL=http://localhost:1234/v1
154154

155+
# ─── LibreDB Embedded Sample ─────────────────────────────────────────────────
156+
# LibreDB embedded sample: on first standalone startup, auto-provide an editable
157+
# "Sample (LibreDB)" connection seeded with example data (one per lens). Default on.
158+
# Set to "false" to disable. Has no effect when embedded in libredb-platform.
159+
# LIBREDB_EMBEDDED_SAMPLE=true
160+
# Optional file path override (default: <data dir>/sample.libredb):
161+
# LIBREDB_EMBEDDED_SAMPLE_PATH=/app/data/sample.libredb
162+
155163
# ─── Seed Connections (pre-configured databases) ─────────────────────────────
156164
# SEED_CONFIG_PATH=/app/config/seed-connections.yaml # Path to seed config file
157165
# SEED_CACHE_TTL_MS=60000 # Cache TTL in ms (default: 60s)

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,9 @@ npmjs-token
105105
.token
106106
.sonar-token
107107
data/
108+
# Local Docker test volumes and any stray embedded-db files
109+
.docker-data*/
110+
*.libredb
111+
112+
docs/superpowers/
113+

docs/providers/libredb.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,24 @@ file does not exist at `connect()` time, the `@libredb/libredb` package will cre
252252
ordered-KV store). If the path is missing entirely, `connect()` throws `DatabaseConfigError`
253253
before attempting to open anything.
254254

255+
### 4.3 Sample connection (standalone mode)
256+
257+
On the first startup of a **standalone** Studio instance (i.e. not embedded inside
258+
libredb-platform), Studio automatically creates a connection named **"Sample (LibreDB)"** seeded
259+
with example data covering each lens (relational table, document collection, raw kv). This gives
260+
new users a working LibreDB file to explore immediately.
261+
262+
The sample connection is fully editable and deletable. Once deleted it stays gone — Studio tracks
263+
dismissed seeds and will not recreate it. It is never injected when Studio runs as an embedded
264+
package inside libredb-platform.
265+
266+
**Env vars:**
267+
268+
| Variable | Default | Notes |
269+
|----------|---------|-------|
270+
| `LIBREDB_EMBEDDED_SAMPLE` | `true` | Set to `"false"` to disable the sample connection entirely. |
271+
| `LIBREDB_EMBEDDED_SAMPLE_PATH` | `<data dir>/sample.libredb` | Optional override for the path of the generated sample file. |
272+
255273
---
256274

257275
## 5. Query interface

0 commit comments

Comments
 (0)