@rip-lang/db 1.3.6 → 1.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +10 -3
  2. package/db.rip +4 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -17,20 +17,27 @@ brew install duckdb # macOS (or see duckdb.org for Linux)
17
17
  bun add -g @rip-lang/db # Installs rip-db command
18
18
 
19
19
  # Start the server
20
- rip-db # In-memory database
21
- rip-db mydata.duckdb # File-based database
20
+ rip-db # Auto-detects *.duckdb file, or :memory:
21
+ rip-db mydata.duckdb # Explicit file
22
22
  rip-db mydata.duckdb --port 8080
23
23
  ```
24
24
 
25
25
  ```
26
26
  rip-db: DuckDB v1.4.4
27
- rip-db: rip-db v1.3.5
27
+ rip-db: rip-db v1.3.6
28
28
  rip-db: source mydata.duckdb
29
29
  rip-db: server http://localhost:4213
30
30
  ```
31
31
 
32
32
  Open **http://localhost:4213** for the official DuckDB UI.
33
33
 
34
+ ### Source Selection
35
+
36
+ When no filename is given, `rip-db` looks for exactly one `*.duckdb` file in
37
+ the current directory and uses it automatically. If zero or multiple are found,
38
+ it falls back to `:memory:`. This means `cd my-project && rip-db` just works
39
+ when there's a single database file present.
40
+
34
41
  The `source` line shows the active data source — today that's a local DuckDB
35
42
  file or `:memory:`, but the architecture supports any source DuckDB can attach:
36
43
  S3 buckets, PostgreSQL, MySQL, SQLite, Parquet files, CSV, and more via
package/db.rip CHANGED
@@ -89,7 +89,10 @@ if '--version' in args or '-v' in args
89
89
  process.exit(0)
90
90
 
91
91
  # Database and port configuration
92
- path = process.env.DB_PATH or args.find((a) -> not a.startsWith('-')) or ':memory:'
92
+ path = process.env.DB_PATH or args.find((a) -> not a.startsWith('-')) or do ->
93
+ glob = new Bun.Glob("*.duckdb")
94
+ files = Array.from(glob.scanSync('.'))
95
+ if files.length is 1 then files[0] else ':memory:'
93
96
 
94
97
  # Support both --port=N and --port N
95
98
  portArg = do ->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rip-lang/db",
3
- "version": "1.3.6",
3
+ "version": "1.3.7",
4
4
  "description": "DuckDB server with official DuckDB UI — pure Bun FFI",
5
5
  "type": "module",
6
6
  "main": "db.rip",