spindb 0.18.0 → 0.19.3

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 (36) hide show
  1. package/README.md +540 -861
  2. package/cli/commands/create.ts +156 -4
  3. package/cli/commands/engines.ts +69 -1
  4. package/cli/commands/menu/container-handlers.ts +113 -78
  5. package/cli/commands/menu/engine-handlers.ts +12 -0
  6. package/cli/commands/menu/index.ts +6 -2
  7. package/cli/commands/menu/shell-handlers.ts +13 -0
  8. package/cli/commands/run.ts +4 -4
  9. package/cli/constants.ts +1 -0
  10. package/cli/helpers.ts +102 -27
  11. package/cli/ui/prompts.ts +13 -9
  12. package/config/backup-formats.ts +16 -0
  13. package/config/engine-defaults.ts +14 -0
  14. package/config/engines.json +16 -0
  15. package/config/os-dependencies.ts +2 -1
  16. package/core/config-manager.ts +26 -0
  17. package/core/container-manager.ts +127 -17
  18. package/core/dependency-manager.ts +22 -0
  19. package/engines/base-engine.ts +8 -0
  20. package/engines/clickhouse/backup.ts +72 -15
  21. package/engines/clickhouse/binary-manager.ts +3 -2
  22. package/engines/clickhouse/binary-urls.ts +14 -3
  23. package/engines/clickhouse/hostdb-releases.ts +19 -4
  24. package/engines/clickhouse/index.ts +6 -4
  25. package/engines/clickhouse/restore.ts +8 -3
  26. package/engines/clickhouse/version-validator.ts +6 -5
  27. package/engines/duckdb/binary-manager.ts +473 -0
  28. package/engines/duckdb/binary-urls.ts +116 -0
  29. package/engines/duckdb/index.ts +689 -0
  30. package/engines/duckdb/registry.ts +303 -0
  31. package/engines/duckdb/version-maps.ts +65 -0
  32. package/engines/duckdb/version-validator.ts +78 -0
  33. package/engines/index.ts +4 -0
  34. package/engines/sqlite/binary-manager.ts +62 -14
  35. package/package.json +5 -4
  36. package/types/index.ts +41 -7
package/README.md CHANGED
@@ -3,1159 +3,821 @@
3
3
  [![npm version](https://img.shields.io/npm/v/spindb.svg)](https://www.npmjs.com/package/spindb)
4
4
  [![npm downloads](https://img.shields.io/npm/dm/spindb.svg)](https://www.npmjs.com/package/spindb)
5
5
  [![License: PolyForm Noncommercial](https://img.shields.io/badge/License-PolyForm%20Noncommercial-blue.svg)](LICENSE)
6
- [![Platform: macOS | Linux | Windows](https://img.shields.io/badge/Platform-macOS%20%7C%20Linux%20%7C%20Windows-lightgrey.svg)](#platform-support-vs-alternatives)
6
+ [![Platform: macOS | Linux | Windows](https://img.shields.io/badge/Platform-macOS%20%7C%20Linux%20%7C%20Windows-lightgrey.svg)](#platform-coverage)
7
7
 
8
- **The first npm CLI for running local databases without Docker.**
8
+ **One CLI for all your local databases.**
9
9
 
10
- Spin up PostgreSQL, MySQL, MariaDB, SQLite, MongoDB, Redis, Valkey, and ClickHouse instances for local development. No Docker daemon, no container networking, no volume mounts. Just databases running on localhost, ready in seconds.
11
-
12
- ---
13
-
14
- ## Quick Start
10
+ SpinDB is a universal database management tool that combines a package manager, a unified API, and native client tooling for 9 different database engines—all from a single command-line interface. No Docker, no VMs, no platform-specific installers. Just databases, running natively on your machine.
15
11
 
16
12
  ```bash
17
- # Install globally (or use pnpm/yarn)
18
13
  npm install -g spindb
19
14
 
20
- # Create and start a PostgreSQL database
21
- spindb create myapp
22
-
23
- # Connect to it
24
- spindb connect myapp
25
-
26
- # You're in! Run some SQL:
27
- # postgres=# CREATE TABLE users (id SERIAL PRIMARY KEY, name TEXT);
28
- ```
29
-
30
- That's it. Your database is running on `localhost:5432`, and your data persists in `~/.spindb/containers/postgresql/myapp/`.
15
+ # PostgreSQL for your API
16
+ spindb create api-db
31
17
 
32
- ---
33
-
34
- ## Why SpinDB?
35
-
36
- Docker is great for production parity and complex multi-service setups. But for local development databases, it's often overkill:
37
-
38
- - **Resource overhead** - Docker Desktop runs a Linux VM on macOS/Windows
39
- - **Complexity** - Volumes, networks, compose files for a single database
40
- - **Startup time** - Container initialization vs native process launch
41
- - **Licensing** - Docker Desktop requires a paid subscription for larger organizations
42
-
43
- Sometimes you just want PostgreSQL on `localhost:5432` without the ceremony.
44
-
45
- SpinDB runs databases as native processes with isolated data directories. No VM, no daemon, no container networking. Just databases.
46
-
47
- ### SpinDB vs Alternatives
48
-
49
- | Feature | SpinDB | Docker | DBngin | Postgres.app | XAMPP |
50
- |---------|--------|--------|--------|--------------|-------|
51
- | No Docker required | ✅ | ❌ | ✅ | ✅ | ✅ |
52
- | Multiple DB engines | ✅ | ✅ | ✅ | ❌ | ⚠️ MySQL only |
53
- | CLI-first | ✅ | ✅ | ❌ | ❌ | ❌ |
54
- | Multiple versions | ✅ | ✅ | ✅ | ✅ | ❌ |
55
- | Clone databases | ✅ | Manual | ✅ | ❌ | ❌ |
56
- | Low resource usage | ✅ | ❌ | ✅ | ✅ | ✅ |
57
- | Linux support | ✅ | ✅ | ❌ | ❌ | ✅ |
58
- | Free | ✅ | ⚠️ | ✅ | ✅ | ✅ |
18
+ # MongoDB for analytics
19
+ spindb create analytics --engine mongodb
59
20
 
60
- ### Platform Support vs Alternatives
21
+ # Redis for caching
22
+ spindb create cache --engine redis
61
23
 
62
- | Platform | SpinDB | Docker | DBngin | Postgres.app | XAMPP |
63
- |----------|--------|--------|--------|--------------|-------|
64
- | macOS (ARM64) | ✅ | ✅ | ✅ | ✅ | ✅ |
65
- | macOS (Intel) | ✅ | ✅ | ✅ | ✅ | ✅ |
66
- | Linux (x64) | ✅ | ✅ | ❌ | ❌ | ✅ |
67
- | Linux (ARM64) | ✅ | ✅ | ❌ | ❌ | ❌ |
68
- | Windows (x64) | ✅ | ✅ | ❌ | ❌ | ✅ |
24
+ # All running side-by-side, all managed the same way
25
+ ```
69
26
 
70
27
  ---
71
28
 
72
- ## Installation
29
+ ## What is SpinDB?
73
30
 
74
- SpinDB is distributed via npm. A global install is recommended so you can run `spindb` from anywhere.
31
+ SpinDB is **three tools in one**:
75
32
 
76
- We recommend [pnpm](https://pnpm.io/) as a faster, more disk-efficient alternative to npm.
33
+ ### 1. **Database Package Manager**
34
+ Download and manage multiple database engines and versions—just like `apt`, `brew`, or `npm`, but for databases.
77
35
 
78
36
  ```bash
79
- # Using pnpm (recommended)
80
- pnpm add -g spindb
81
-
82
- # Using npm
83
- npm install -g spindb
37
+ # Run PostgreSQL 14 for legacy projects, 18 for new ones
38
+ spindb create old-project --engine postgresql --db-version 14
39
+ spindb create new-project --engine postgresql --db-version 18
84
40
 
85
- # Or run directly without installing
86
- pnpx spindb
87
- npx spindb
41
+ # Or MySQL 8.0 alongside MySQL 9
42
+ spindb create legacy-mysql --engine mysql --db-version 8.0
43
+ spindb create modern-mysql --engine mysql --db-version 9
88
44
  ```
89
45
 
90
- ### Updating
91
-
92
- SpinDB checks for updates automatically and notifies you when a new version is available.
46
+ ### 2. **Unified Database API**
47
+ One consistent interface across SQL databases, document stores, key-value stores, and analytics engines.
93
48
 
94
49
  ```bash
95
- # Update to latest version
96
- spindb self-update
97
-
98
- # Or check manually
99
- spindb version --check
100
-
101
- # Disable automatic update checks
102
- spindb config update-check off
50
+ # Same commands work for ANY database
51
+ spindb create mydb --engine [postgresql|mysql|mariadb|mongodb|redis|valkey|clickhouse|sqlite|duckdb]
52
+ spindb start mydb
53
+ spindb connect mydb
54
+ spindb backup mydb
55
+ spindb restore mydb backup.dump
103
56
  ```
104
57
 
105
- ---
106
-
107
- ## The Interactive Menu
108
-
109
- Most of the time, you don't need to remember commands. Just run:
58
+ ### 3. **Native Database Client**
59
+ Access built-in shells, run queries, and execute scripts—all without installing separate clients.
110
60
 
111
61
  ```bash
112
- spindb
113
- ```
114
-
115
- You'll get an interactive menu with arrow-key navigation:
116
-
117
- ```
118
- ? What would you like to do?
119
- ❯ Create a new container
120
- Manage containers
121
- View installed engines
122
- Check dependencies
123
- Settings
124
- Exit
62
+ # Execute SQL/NoSQL/commands across any engine
63
+ spindb run mydb script.sql # PostgreSQL/MySQL/SQLite
64
+ spindb run mydb -c "db.users.find().pretty()" # MongoDB
65
+ spindb run mydb -c "SET mykey myvalue" # Redis/Valkey
66
+ spindb run mydb -c "SELECT * FROM system.tables" # ClickHouse
125
67
  ```
126
68
 
127
- **Everything in the menu is also available as a CLI command.** The menu is just a friendlier interface for the same operations. If you prefer typing commands or scripting, SpinDB has full CLI support.
128
-
129
69
  ---
130
70
 
131
- ## Database Engines
132
-
133
- ### Supported Engines
134
-
135
- #### PostgreSQL
136
-
137
- | | |
138
- |---|---|
139
- | Versions | 15, 16, 17, 18 |
140
- | Default port | 5432 |
141
- | Default user | `postgres` |
142
- | Binary source | [hostdb](https://github.com/robertjbass/hostdb) (macOS/Linux), [EDB](https://www.enterprisedb.com/) (Windows) |
143
-
144
- SpinDB downloads PostgreSQL server binaries automatically:
145
- - **macOS/Linux:** Pre-compiled binaries from [hostdb](https://github.com/robertjbass/hostdb) on GitHub Releases
146
- - **Windows:** Official binaries from EnterpriseDB (EDB)
71
+ ## Platform Coverage
147
72
 
148
- **Why download binaries instead of using system PostgreSQL?** The hostdb project provides pre-configured, portable PostgreSQL binaries—just extract and run. This lets you run PostgreSQL 14 for one project and 18 for another, side-by-side, without conflicts.
73
+ SpinDB works across **9 database engines** and **5 platform architectures** with a **single, consistent API**.
149
74
 
150
- **Client tools included:** PostgreSQL binaries include `psql`, `pg_dump`, and `pg_restore` for all operations.
75
+ | Database | macOS ARM64 | macOS Intel | Linux x64 | Linux ARM64 | Windows x64 |
76
+ |----------|:-----------:|:-----------:|:---------:|:-----------:|:-----------:|
77
+ | 🐘 **PostgreSQL** | ✅ | ✅ | ✅ | ✅ | ✅ |
78
+ | 🐬 **MySQL** | ✅ | ✅ | ✅ | ✅ | ✅ |
79
+ | 🦭 **MariaDB** | ✅ | ✅ | ✅ | ✅ | ✅ |
80
+ | 🪶 **SQLite** | ✅ | ✅ | ✅ | ✅ | ✅ |
81
+ | 🦆 **DuckDB** | ✅ | ✅ | ✅ | ✅ | ✅ |
82
+ | 🍃 **MongoDB** | ✅ | ✅ | ✅ | ✅ | ✅ |
83
+ | 🔴 **Redis** | ✅ | ✅ | ✅ | ✅ | ✅ |
84
+ | 🔷 **Valkey** | ✅ | ✅ | ✅ | ✅ | ✅ |
85
+ | 🏠 **ClickHouse** | ✅ | ✅ | ✅ | ✅ | ❌ |
86
+
87
+ **44 combinations. One CLI. Zero configuration.**
151
88
 
152
- #### MariaDB
89
+ ---
153
90
 
154
- | | |
155
- |---|---|
156
- | Versions | 10.11, 11.4, 11.8 |
157
- | Default port | 3307 |
158
- | Default user | `root` |
159
- | Binary source | [hostdb](https://github.com/robertjbass/hostdb) |
91
+ ## Quick Start
160
92
 
161
- SpinDB downloads MariaDB server binaries automatically from [hostdb](https://github.com/robertjbass/hostdb) on GitHub Releases—just like PostgreSQL. This provides multi-version support and works across all platforms.
93
+ Install SpinDB globally using your preferred package manager:
162
94
 
163
95
  ```bash
164
- # Create a MariaDB container
165
- spindb create mydb --engine mariadb
96
+ # Using npm
97
+ npm install -g spindb
166
98
 
167
- # Or using the alias
168
- spindb create mydb -e maria
99
+ # Using pnpm (recommended - faster, more efficient)
100
+ pnpm add -g spindb
169
101
 
170
- # Check what's available
171
- spindb deps check --engine mariadb
102
+ # Or run without installing
103
+ npx spindb
172
104
  ```
173
105
 
174
- MariaDB is MySQL-compatible, so most MySQL tools and clients work seamlessly. If you need MySQL-specific features, use the `mysql` engine instead.
175
-
176
- #### MySQL
177
-
178
- | | |
179
- |---|---|
180
- | Versions | 8.0, 8.4, 9 |
181
- | Default port | 3306 |
182
- | Default user | `root` |
183
- | Binary source | [hostdb](https://github.com/robertjbass/hostdb) |
184
-
185
- SpinDB downloads MySQL server binaries automatically from [hostdb](https://github.com/robertjbass/hostdb) on GitHub Releases—just like PostgreSQL and MariaDB. This provides multi-version support and works across all platforms.
106
+ Create and start a database in seconds:
186
107
 
187
108
  ```bash
188
- # Create a MySQL container
189
- spindb create mydb --engine mysql
190
-
191
- # Create with specific version
192
- spindb create mydb --engine mysql --version 8.0
109
+ # PostgreSQL (default engine)
110
+ spindb create myapp
111
+ spindb start myapp
112
+ spindb connect myapp
193
113
 
194
- # Check what's available
195
- spindb deps check --engine mysql
114
+ # Or all in one command
115
+ spindb create myapp --start --connect
196
116
  ```
197
117
 
198
- **Client tools included:** MySQL binaries include `mysql`, `mysqldump`, and `mysqladmin` for all operations. No system installation required.
199
-
200
- #### SQLite
118
+ That's it! Your PostgreSQL database is now running on `localhost:5432`, and data persists in `~/.spindb/containers/postgresql/myapp/`.
201
119
 
202
- | | |
203
- |---|---|
204
- | Version | 3 |
205
- | Default port | N/A (file-based) |
206
- | Data location | Project directory (CWD) |
207
- | Binary source | [hostdb](https://github.com/robertjbass/hostdb) |
208
-
209
- SQLite is a file-based database—no server process, no ports. Databases are stored in your project directory by default, not `~/.spindb/`. SpinDB tracks registered SQLite databases in a registry file.
210
-
211
- **Tools included:** SQLite binaries include `sqlite3`, `sqldiff`, `sqlite3_analyzer`, and `sqlite3_rsync`. No system installation required.
120
+ ### Try Other Engines
212
121
 
213
122
  ```bash
214
- # Create in current directory
215
- spindb create mydb --engine sqlite
123
+ # MySQL for relational data
124
+ spindb create shop --engine mysql --start --connect
216
125
 
217
- # Create with custom path
218
- spindb create mydb --engine sqlite --path ./data/mydb.sqlite
126
+ # MongoDB for document storage
127
+ spindb create logs --engine mongodb --start
219
128
 
220
- # Connect to it
221
- spindb connect mydb
129
+ # Redis for caching and real-time features
130
+ spindb create sessions --engine redis --start
222
131
 
223
- # Use litecli for enhanced experience
224
- spindb connect mydb --litecli
132
+ # DuckDB for analytics
133
+ spindb create analytics --engine duckdb --start
225
134
  ```
226
135
 
227
- **Note:** Unlike server databases, SQLite databases don't need to be "started" or "stopped"—they're always available as long as the file exists.
136
+ Every engine works the same way. Learn one, use them all.
228
137
 
229
- #### MongoDB
138
+ ---
230
139
 
231
- | | |
232
- |---|---|
233
- | Versions | 7.0, 8.0, 8.2 |
234
- | Default port | 27017 |
235
- | Default user | None (no auth by default) |
236
- | Binary source | [hostdb](https://github.com/robertjbass/hostdb) |
140
+ ## Why SpinDB?
237
141
 
238
- SpinDB downloads MongoDB server binaries automatically from [hostdb](https://github.com/robertjbass/hostdb) on GitHub Releases—just like PostgreSQL, MariaDB, and MySQL. This provides multi-version support on all platforms.
142
+ ### The Problem with Current Tools
239
143
 
240
- ```bash
241
- # Create a MongoDB container (downloads binaries automatically)
242
- spindb create mydb --engine mongodb
144
+ **Docker** is powerful but heavy—requires a daemon, runs containers in a VM (on macOS/Windows), and adds complexity for simple local databases.
243
145
 
244
- # Create with specific version
245
- spindb create mydb --engine mongodb --version 8.0
146
+ **GUI tools** like DBngin and Postgres.app are great but platform-specific, don't support scripting, and lack a unified interface across engines.
246
147
 
247
- # Check what's available
248
- spindb deps check --engine mongodb
249
- ```
148
+ **System package managers** (brew, apt, etc.) work but create version conflicts, require manual configuration, and don't provide consistent management across databases.
250
149
 
251
- MongoDB uses JavaScript for queries instead of SQL. When using `spindb run`, pass JavaScript code:
150
+ ### SpinDB's Approach
252
151
 
253
- ```bash
254
- # Insert a document
255
- spindb run mydb -c "db.users.insertOne({name: 'Alice', email: 'alice@example.com'})"
152
+ SpinDB runs databases as **native processes** with **isolated data directories**:
256
153
 
257
- # Query documents
258
- spindb run mydb -c "db.users.find().pretty()"
154
+ - **No Docker daemon or VM overhead** - Direct process execution
155
+ - **No system installation conflicts** - Each database version lives in `~/.spindb/bin/`
156
+ - **No manual configuration** - Databases start with sensible defaults
157
+ - **Cross-platform consistency** - Same commands work on macOS, Linux, and Windows
158
+ - **Multi-version support** - Run PostgreSQL 14 and 18 side-by-side
159
+ - **Unified interface** - Manage PostgreSQL, MongoDB, and Redis the same way
259
160
 
260
- # Run a JavaScript file
261
- spindb run mydb --file ./scripts/seed.js
262
- ```
161
+ ### Comparison Matrix
263
162
 
264
- #### Redis
163
+ | Feature | SpinDB | Docker | DBngin | Postgres.app | XAMPP |
164
+ |---------|--------|--------|--------|--------------|-------|
165
+ | No Docker required | ✅ | ❌ | ✅ | ✅ | ✅ |
166
+ | Multiple DB engines | ✅ 9 engines | ✅ Unlimited | ✅ 3 engines | ❌ PostgreSQL only | ⚠️ MySQL only |
167
+ | CLI-first | ✅ | ✅ | ❌ GUI-first | ❌ GUI-first | ❌ GUI-first |
168
+ | Multiple versions | ✅ | ✅ | ✅ | ✅ | ❌ |
169
+ | Clone databases | ✅ | Manual | ✅ | ❌ | ❌ |
170
+ | Backup/restore built-in | ✅ | Manual | ✅ | ❌ | ❌ |
171
+ | Low resource usage | ✅ Native | ❌ VM on macOS/Win | ✅ Native | ✅ Native | ✅ Native |
172
+ | Linux support | ✅ | ✅ | ❌ | ❌ | ✅ |
173
+ | ARM64 support | ✅ | ✅ | ✅ | ✅ | ❌ |
174
+ | Free for commercial use | ❌ | ⚠️ Paid for orgs | ✅ | ✅ | ✅ |
265
175
 
266
- | | |
267
- |---|---|
268
- | Versions | 7, 8 |
269
- | Default port | 6379 |
270
- | Default user | None (no auth by default) |
271
- | Binary source | [hostdb](https://github.com/robertjbass/hostdb) |
176
+ ---
272
177
 
273
- SpinDB downloads Redis server binaries automatically from [hostdb](https://github.com/robertjbass/hostdb) on GitHub Releases—just like PostgreSQL, MariaDB, MySQL, and MongoDB. This provides multi-version support on all platforms.
178
+ ## Supported Databases
274
179
 
275
- ```bash
276
- # Create a Redis container (downloads binaries automatically)
277
- spindb create mydb --engine redis
180
+ SpinDB supports **9 database engines** with **multiple versions** for each:
278
181
 
279
- # Create with specific version
280
- spindb create mydb --engine redis --version 8
182
+ | Engine | Type | Versions | Default Port | Query Language |
183
+ |--------|------|----------|--------------|----------------|
184
+ | 🐘 **PostgreSQL** | Relational (SQL) | 15, 16, 17, 18 | 5432 | SQL |
185
+ | 🐬 **MySQL** | Relational (SQL) | 8.0, 8.4, 9 | 3306 | SQL |
186
+ | 🦭 **MariaDB** | Relational (SQL) | 10.11, 11.4, 11.8 | 3307 | SQL |
187
+ | 🪶 **SQLite** | Embedded (SQL) | 3 | N/A (file-based) | SQL |
188
+ | 🦆 **DuckDB** | Embedded OLAP | 1.4.3 | N/A (file-based) | SQL |
189
+ | 🍃 **MongoDB** | Document Store | 7.0, 8.0, 8.2 | 27017 | JavaScript (mongosh) |
190
+ | 🔴 **Redis** | Key-Value Store | 7, 8 | 6379 | Redis commands |
191
+ | 🔷 **Valkey** | Key-Value Store | 8, 9 | 6379 | Redis commands |
192
+ | 🏠 **ClickHouse** | Columnar OLAP | 25.12 | 9000 (TCP), 8123 (HTTP) | SQL (ClickHouse dialect) |
281
193
 
282
- # Check what's available
283
- spindb deps check --engine redis
284
- ```
194
+ ### Engine Categories
285
195
 
286
- Redis uses numbered databases (0-15) instead of named databases. When using `spindb run`, pass Redis commands:
196
+ **Server-Based Databases** (PostgreSQL, MySQL, MariaDB, MongoDB, Redis, Valkey, ClickHouse):
197
+ - Start/stop server processes
198
+ - Bind to localhost ports
199
+ - Data stored in `~/.spindb/containers/{engine}/{name}/`
287
200
 
288
- ```bash
289
- # Set a key
290
- spindb run myredis -c "SET mykey myvalue"
201
+ **File-Based Databases** (SQLite, DuckDB):
202
+ - No server process required
203
+ - Data stored in your project directories
204
+ - Always "running" (embedded, no daemon)
291
205
 
292
- # Get a key
293
- spindb run myredis -c "GET mykey"
206
+ ### Binary Sources
294
207
 
295
- # Run a Redis command file
296
- spindb run myredis --file ./scripts/seed.redis
208
+ All engines download pre-compiled binaries from [**hostdb**](https://github.com/robertjbass/hostdb), a repository of portable database binaries for all major platforms:
297
209
 
298
- # Use iredis for enhanced shell experience
299
- spindb connect myredis --iredis
300
- ```
210
+ - **PostgreSQL**: hostdb (macOS/Linux), [EnterpriseDB](https://www.enterprisedb.com/) (Windows)
211
+ - **All other engines**: hostdb (all supported platforms)
301
212
 
302
- **Note:** Redis doesn't support remote dump/restore. Creating containers from remote Redis connection strings is not supported. Use `backup` and `restore` commands for data migration.
213
+ This enables **multi-version support** without system package conflicts. Run PostgreSQL 14 for legacy projects and 18 for new ones—simultaneously.
303
214
 
304
- #### Valkey
215
+ ---
305
216
 
306
- | | |
307
- |---|---|
308
- | Versions | 8, 9 |
309
- | Default port | 6379 |
310
- | Default user | None (no auth by default) |
311
- | Binary source | [hostdb](https://github.com/robertjbass/hostdb) |
217
+ ## Core Commands
312
218
 
313
- Valkey is a Redis fork created after Redis changed its license (RSALv2/SSPLv1). It's fully API-compatible with Redis, making it a drop-in replacement with permissive BSD-3 licensing.
219
+ SpinDB provides a comprehensive CLI with commands for every database lifecycle operation.
314
220
 
315
- SpinDB downloads Valkey server binaries automatically from [hostdb](https://github.com/robertjbass/hostdb) on GitHub Releases. This provides multi-version support on all platforms.
221
+ ### Container Lifecycle
316
222
 
317
223
  ```bash
318
- # Create a Valkey container (downloads binaries automatically)
319
- spindb create mydb --engine valkey
224
+ # Create a new database
225
+ spindb create mydb # PostgreSQL (default)
226
+ spindb create mydb --engine mongodb # MongoDB
227
+ spindb create mydb --engine mysql --db-version 8.0 # MySQL 8.0
228
+ spindb create mydb --port 5433 # Custom port
229
+ spindb create mydb --start --connect # Create, start, and connect
320
230
 
321
- # Create with specific version
322
- spindb create mydb --engine valkey --version 9
231
+ # Start/stop databases
232
+ spindb start mydb
233
+ spindb stop mydb
323
234
 
324
- # Check what's available
325
- spindb deps check --engine valkey
235
+ # Delete database (with confirmation)
236
+ spindb delete mydb
237
+ spindb delete mydb --yes --force # Skip prompts, force stop
326
238
  ```
327
239
 
328
- Valkey uses the same commands as Redis:
240
+ ### Data Operations
329
241
 
330
242
  ```bash
331
- # Set a key
332
- spindb run myvalkey -c "SET mykey myvalue"
243
+ # Connect to database shell
244
+ spindb connect mydb # Standard client (psql, mysql, etc.)
245
+ spindb connect mydb --pgcli # Enhanced PostgreSQL shell
246
+ spindb connect mydb --mycli # Enhanced MySQL shell
247
+ spindb connect mydb --tui # Universal SQL client (usql)
333
248
 
334
- # Get a key
335
- spindb run myvalkey -c "GET mykey"
249
+ # Execute queries and scripts
250
+ spindb run mydb script.sql # Run SQL file
251
+ spindb run mydb -c "SELECT * FROM users" # Inline SQL
252
+ spindb run mydb seed.js # JavaScript (MongoDB)
253
+ spindb run mydb -c "SET foo bar" # Redis command
336
254
 
337
- # Run a command file
338
- spindb run myvalkey --file ./scripts/seed.valkey
255
+ # Get connection string
256
+ spindb url mydb # postgresql://postgres@localhost:5432/mydb
257
+ spindb url mydb --copy # Copy to clipboard
258
+ spindb url mydb --json # JSON output with details
339
259
 
340
- # Use iredis for enhanced shell experience (Redis-protocol compatible)
341
- spindb connect myvalkey --iredis
260
+ # Use in scripts
261
+ export DATABASE_URL=$(spindb url mydb)
262
+ psql $(spindb url mydb)
342
263
  ```
343
264
 
344
- **Note:** Valkey uses `redis://` connection scheme for client compatibility since it's wire-compatible with Redis.
345
-
346
- #### ClickHouse
347
-
348
- | | |
349
- |---|---|
350
- | Versions | 25.12 |
351
- | Default port | 9000 (native TCP), 8123 (HTTP) |
352
- | Default user | `default` |
353
- | Binary source | [hostdb](https://github.com/robertjbass/hostdb) |
354
-
355
- ClickHouse is a column-oriented OLAP database designed for fast analytics on large datasets. SpinDB downloads ClickHouse server binaries automatically from [hostdb](https://github.com/robertjbass/hostdb) on GitHub Releases.
356
-
357
- **Note:** ClickHouse is only available on macOS and Linux. Windows is not supported.
265
+ ### Backup & Restore
358
266
 
359
267
  ```bash
360
- # Create a ClickHouse container (downloads binaries automatically)
361
- spindb create mydb --engine clickhouse
268
+ # Create backups
269
+ spindb backup mydb # Auto-generated filename
270
+ spindb backup mydb --name production-backup # Custom name
271
+ spindb backup mydb --output ./backups/ # Custom directory
272
+ spindb backup mydb --format sql # SQL text format
273
+ spindb backup mydb --format dump # Binary format
362
274
 
363
- # Create with specific version
364
- spindb create mydb --engine clickhouse --version 25.12
275
+ # Restore from backups
276
+ spindb restore mydb backup.dump
277
+ spindb restore mydb backup.sql --database prod_copy
278
+
279
+ # Pull from remote database
280
+ spindb restore mydb --from-url "postgresql://user:pass@prod-host/db"
365
281
 
366
- # Check what's available
367
- spindb deps check --engine clickhouse
282
+ # Clone existing database
283
+ spindb create prod-copy --from ./prod-backup.dump
284
+ spindb create staging --from "postgresql://user:pass@prod:5432/production"
368
285
  ```
369
286
 
370
- ClickHouse uses SQL (with ClickHouse-specific extensions):
287
+ ### Container Management
371
288
 
372
289
  ```bash
373
- # Create a table
374
- spindb run mych -c "CREATE TABLE users (id UInt64, name String) ENGINE = MergeTree() ORDER BY id"
290
+ # List all databases
291
+ spindb list
292
+ spindb list --json
375
293
 
376
- # Insert data
377
- spindb run mych -c "INSERT INTO users VALUES (1, 'Alice'), (2, 'Bob')"
294
+ # Show container details
295
+ spindb info mydb
296
+ spindb info mydb --json
378
297
 
379
- # Query data
380
- spindb run mych -c "SELECT * FROM users"
298
+ # Clone a database
299
+ spindb clone source-db new-db
381
300
 
382
- # Run a SQL file
383
- spindb run mych --file ./scripts/seed.sql
301
+ # Edit configuration
302
+ spindb edit mydb --name newname # Rename
303
+ spindb edit mydb --port 5433 # Change port
304
+ spindb edit mydb --relocate ~/new/path # Move SQLite/DuckDB file
305
+
306
+ # View logs
307
+ spindb logs mydb
308
+ spindb logs mydb --follow # Follow mode (tail -f)
309
+ spindb logs mydb -n 100 # Last 100 lines
384
310
  ```
385
311
 
386
- ### hostdb Platform Coverage
312
+ ### Engine & System Management
387
313
 
388
- SpinDB downloads database binaries from [hostdb](https://github.com/robertjbass/hostdb), a repository of pre-built database binaries for all major platforms. The following table shows current platform support and integration status:
314
+ ```bash
315
+ # Manage installed engines
316
+ spindb engines # List installed engines
317
+ spindb engines supported # Show all supported engines
318
+ spindb engines delete postgresql 16 # Remove specific version
389
319
 
390
- | Icon | Meaning |
391
- |:----:|---------|
392
- | | Integrated with SpinDB |
393
- | 🟦 | Pending SpinDB integration (hostdb ready) |
394
- | 🟪 | Planned for hostdb (pending/in-progress) |
320
+ # Manage client tools
321
+ spindb deps check # Check all dependencies
322
+ spindb deps check --engine postgresql # Check specific engine
323
+ spindb deps install # Install missing tools
395
324
 
396
- | Database | macOS ARM64 | macOS Intel | Linux x64 | Linux ARM64 | Windows x64 |
397
- |----------|:-----------:|:-----------:|:---------:|:-----------:|:-----------:|
398
- | **Integrated** |||||
399
- | PostgreSQL | | | ✅ | ✅ | ✅ |
400
- | MySQL | ✅ | ✅ | ✅ | ✅ | ✅ |
401
- | MariaDB | ✅ | ✅ | ✅ | ✅ | ✅ |
402
- | SQLite | ✅ | ✅ | ✅ | ✅ | ✅ |
403
- | MongoDB* | ✅ | ✅ | ✅ | ✅ | ✅ |
404
- | Redis* | ✅ | ✅ | ✅ | ✅ | ✅ |
405
- | Valkey | ✅ | ✅ | ✅ | ✅ | ✅ |
406
- | ClickHouse* | ✅ | ✅ | ✅ | ✅ | ❌ |
407
- | **Planned for hostdb** |||||
408
- | CockroachDB | 🟪 | 🟪 | 🟪 | 🟪 | 🟪 |
409
- | TimescaleDB | 🟪 | 🟪 | 🟪 | 🟪 | 🟪 |
410
- | DuckDB | 🟪 | 🟪 | 🟪 | 🟪 | 🟪 |
411
- | Meilisearch | 🟪 | 🟪 | 🟪 | 🟪 | 🟪 |
412
- | OpenSearch | 🟪 | 🟪 | 🟪 | 🟪 | 🟪 |
413
- | QuestDB | 🟪 | 🟪 | 🟪 | 🟪 | 🟪 |
414
- | FerretDB | 🟪 | 🟪 | 🟪 | 🟪 | 🟪 |
415
- | TiDB | 🟪 | 🟪 | 🟪 | 🟪 | 🟪 |
416
- | ArangoDB | 🟪 | 🟪 | 🟪 | 🟪 | 🟪 |
417
- | Qdrant | 🟪 | 🟪 | 🟪 | 🟪 | 🟪 |
418
- | Apache Cassandra | 🟪 | 🟪 | 🟪 | 🟪 | 🟪 |
419
- | InfluxDB | 🟪 | 🟪 | 🟪 | 🟪 | 🟪 |
420
- | CouchDB | 🟪 | 🟪 | 🟪 | 🟪 | 🟪 |
421
- | KeyDB | 🟪 | 🟪 | 🟪 | 🟪 | 🟪 |
422
- | libSQL | 🟪 | 🟪 | 🟪 | 🟪 | 🟪 |
423
- | FoundationDB | 🟪 | 🟪 | 🟪 | 🟪 | 🟪 |
424
- | RocksDB | 🟪 | 🟪 | 🟪 | 🟪 | 🟪 |
425
-
426
- **Notes:**
427
- - **\*** Licensing considerations for commercial use — consider Valkey (Redis) or FerretDB (MongoDB) as alternatives
428
- - **PostgreSQL** uses [EDB](https://www.enterprisedb.com/) binaries on Windows instead of hostdb
429
- - **ClickHouse** Windows binaries are not available on hostdb (macOS and Linux only)
430
- - **Valkey** is a Redis-compatible drop-in replacement with permissive licensing
431
- - **CockroachDB** is planned for both hostdb and SpinDB (see [roadmap](TODO.md))
432
- - All databases under "Planned for hostdb" have permissive open-source licenses (Apache 2.0, MIT, or BSD)
433
-
434
- For the latest platform support, see the [hostdb databases.json](https://github.com/robertjbass/hostdb/blob/main/databases.json).
325
+ # Configuration
326
+ spindb config show # Show current config
327
+ spindb config detect # Re-detect tool paths
328
+ spindb config update-check on # Enable update notifications
435
329
 
436
- ---
330
+ # System health
331
+ spindb doctor # Interactive health check
332
+ spindb doctor --json # JSON output
437
333
 
438
- ## Commands
334
+ # Version management
335
+ spindb version # Show current version
336
+ spindb version --check # Check for updates
337
+ spindb self-update # Update to latest version
338
+ ```
439
339
 
440
- ### Container Lifecycle
340
+ ### Interactive Menu
441
341
 
442
- #### `create` - Create a new container
342
+ Don't want to remember commands? Just run:
443
343
 
444
344
  ```bash
445
- spindb create mydb # PostgreSQL (default)
446
- spindb create mydb --engine mariadb # MariaDB
447
- spindb create mydb --engine mysql # MySQL
448
- spindb create mydb --engine sqlite # SQLite (file-based)
449
- spindb create mydb --db-version 16 # Specific PostgreSQL version
450
- spindb create mydb --port 5433 # Custom port
451
- spindb create mydb --database my_app # Custom database name
452
- spindb create mydb --no-start # Create without starting
453
-
454
- # Create, start, and connect in one command
455
- spindb create mydb --start --connect
456
-
457
- # SQLite with custom path
458
- spindb create mydb --engine sqlite --path ./data/app.sqlite
345
+ spindb
459
346
  ```
460
347
 
461
- Create and restore in one command:
348
+ You'll get an interactive menu with arrow-key navigation for all operations. **The menu is just a friendlier interface—everything is also available as a direct CLI command.**
462
349
 
463
- ```bash
464
- spindb create mydb --from ./backup.dump
465
- spindb create mydb --from "postgresql://user:pass@host:5432/production"
466
- ```
350
+ ---
467
351
 
468
- <details>
469
- <summary>All options</summary>
352
+ ## How It Works
470
353
 
471
- | Option | Description |
472
- |--------|-------------|
473
- | `--engine`, `-e` | Database engine (`postgresql`, `mariadb`, `mysql`, `sqlite`, `mongodb`, `redis`, `valkey`) |
474
- | `--db-version` | Engine version (e.g., 17 for PostgreSQL, 11.8 for MariaDB, 8 for Redis, 9 for Valkey) |
475
- | `--port`, `-p` | Port number (not applicable for SQLite) |
476
- | `--database`, `-d` | Primary database name (Redis uses 0-15) |
477
- | `--path` | File path for SQLite databases |
478
- | `--max-connections` | Maximum database connections (default: 200) |
479
- | `--from` | Restore from backup file or connection string |
480
- | `--start` | Start container after creation (skip prompt) |
481
- | `--no-start` | Create without starting |
482
- | `--connect` | Open a shell connection after creation |
354
+ ### Architecture
483
355
 
484
- </details>
356
+ SpinDB uses "container" terminology loosely—there's no Docker involved. When you create a container, SpinDB:
485
357
 
486
- #### `start` - Start a container
358
+ 1. **Downloads database binaries** from [hostdb](https://github.com/robertjbass/hostdb) or uses system installations
359
+ 2. **Creates isolated data directories** at `~/.spindb/containers/{engine}/{name}/`
360
+ 3. **Runs databases as native processes** on your machine
487
361
 
488
- ```bash
489
- spindb start mydb
490
- ```
362
+ Each container contains:
363
+ - `container.json` - Configuration (port, version, status)
364
+ - `data/` - Database files
365
+ - `{engine}.log` - Server logs
491
366
 
492
- #### `stop` - Stop a container
367
+ ### Storage Layout
493
368
 
494
369
  ```bash
495
- spindb stop mydb
370
+ ~/.spindb/
371
+ ├── bin/ # Downloaded binaries
372
+ │ ├── postgresql-18.1.0-darwin-arm64/ # ~45 MB
373
+ │ ├── mysql-9.0.1-darwin-arm64/ # ~200 MB
374
+ │ └── mongodb-8.0-darwin-arm64/ # ~200 MB
375
+ ├── containers/ # Server-based databases
376
+ │ ├── postgresql/
377
+ │ │ └── myapp/
378
+ │ │ ├── container.json
379
+ │ │ ├── data/
380
+ │ │ └── postgres.log
381
+ │ ├── mysql/
382
+ │ └── mongodb/
383
+ ├── logs/ # SpinDB error logs
384
+ └── config.json # Tool paths and settings
385
+
386
+ # File-based databases (SQLite, DuckDB) store in project directories
387
+ ./myproject/
388
+ └── app.sqlite # Created with: spindb create app -e sqlite
496
389
  ```
497
390
 
498
- #### `delete` - Delete a container
391
+ ### Data Persistence
499
392
 
500
- ```bash
501
- spindb delete mydb
502
- spindb delete mydb --yes # Skip confirmation prompt
503
- spindb delete mydb --force # Force stop if running
504
- spindb delete mydb -fy # Both: force stop + skip confirmation
505
- ```
393
+ Databases run as **native processes**, and **data persists across restarts**. When you stop a container:
506
394
 
507
- <details>
508
- <summary>All options</summary>
395
+ 1. SpinDB sends a graceful shutdown signal
396
+ 2. The database flushes pending writes to disk
397
+ 3. Data remains in the `data/` directory
509
398
 
510
- | Option | Description |
511
- |--------|-------------|
512
- | `--force`, `-f` | Force stop if container is running before deleting |
513
- | `--yes`, `-y` | Skip confirmation prompt (for scripts/automation) |
514
- | `--json`, `-j` | Output result as JSON |
399
+ **Your data is never deleted unless you explicitly run `spindb delete`.**
515
400
 
516
- </details>
401
+ #### Durability by Engine
517
402
 
518
- ### Data Operations
403
+ | Engine | Persistence Mechanism | Durability |
404
+ |--------|----------------------|------------|
405
+ | PostgreSQL | Write-Ahead Logging (WAL) | Committed transactions survive crashes |
406
+ | MySQL | InnoDB transaction logs | Committed transactions survive crashes |
407
+ | MariaDB | InnoDB transaction logs | Committed transactions survive crashes |
408
+ | SQLite | File-based transactions | Commits written immediately to disk |
409
+ | DuckDB | File-based transactions | Commits written immediately to disk |
410
+ | MongoDB | WiredTiger journaling | Writes journaled before acknowledged |
411
+ | Redis | RDB snapshots (periodic) | May lose ~60 seconds on unexpected crash |
412
+ | Valkey | RDB snapshots (periodic) | May lose ~60 seconds on unexpected crash |
413
+ | ClickHouse | MergeTree storage | Committed transactions survive crashes |
519
414
 
520
- #### `connect` - Open database shell
415
+ ---
521
416
 
522
- ```bash
523
- spindb connect mydb # Standard shell (psql/mysql)
524
- spindb connect mydb --pgcli # Enhanced PostgreSQL shell
525
- spindb connect mydb --mycli # Enhanced MySQL shell
526
- spindb connect mydb --tui # Universal SQL client (usql)
527
- ```
417
+ ## Engine-Specific Details
528
418
 
529
- Install enhanced shells on-the-fly:
419
+ Each database engine has unique features and behaviors. See full documentation in [ENGINES.md](ENGINES.md).
530
420
 
531
- ```bash
532
- spindb connect mydb --install-pgcli
533
- spindb connect mydb --install-mycli
534
- spindb connect mydb --install-tui
535
- ```
536
-
537
- #### `run` - Execute SQL/scripts/commands
421
+ ### PostgreSQL 🐘
538
422
 
539
423
  ```bash
540
- spindb run mydb script.sql # Run a SQL file
541
- spindb run mydb -c "SELECT * FROM users" # Run inline SQL
542
- spindb run mydb seed.sql --database my_app # Target specific database
424
+ # Create PostgreSQL database
425
+ spindb create myapp --engine postgresql --db-version 18
543
426
 
544
- # MongoDB uses JavaScript instead of SQL
545
- spindb run mydb seed.js # Run a JavaScript file
546
- spindb run mydb -c "db.users.find().pretty()" # Run inline JavaScript
427
+ # Multiple versions side-by-side
428
+ spindb create legacy --engine postgresql --db-version 14
429
+ spindb create modern --engine postgresql --db-version 18
547
430
 
548
- # Redis uses Redis commands
549
- spindb run myredis -c "SET foo bar" # Run inline command
550
- spindb run myredis seed.redis # Run command file
431
+ # Backup formats
432
+ spindb backup myapp --format sql # Plain SQL (.sql)
433
+ spindb backup myapp --format dump # Binary custom format (.dump)
551
434
  ```
552
435
 
553
- #### `url` - Get connection string
554
-
555
- ```bash
556
- spindb url mydb # postgresql://postgres@localhost:5432/mydb
557
- spindb url mydb --copy # Copy to clipboard
558
- spindb url mydb --json # JSON output with details
436
+ **Versions:** 15, 16, 17, 18
437
+ **Tools:** `psql`, `pg_dump`, `pg_restore` (included)
438
+ **Enhanced client:** `pgcli` (auto-completion, syntax highlighting)
559
439
 
560
- # Use in scripts
561
- export DATABASE_URL=$(spindb url mydb)
562
- psql $(spindb url mydb)
563
- ```
564
-
565
- #### `backup` - Create a backup
566
-
567
- ```bash
568
- spindb backup mydb # Auto-generated filename
569
- spindb backup mydb --name my-backup # Custom name
570
- spindb backup mydb --output ./backups/ # Custom directory
571
- spindb backup mydb --database my_app # Backup specific database
572
- ```
573
-
574
- Backup formats (vary by engine):
440
+ ### MySQL 🐬 & MariaDB 🦭
575
441
 
576
442
  ```bash
577
- spindb backup mydb --format sql # Plain SQL (.sql) or text commands (.redis)
578
- spindb backup mydb --format dump # Binary format (.dump for PG, .sql.gz for MySQL, .rdb for Redis)
443
+ # MySQL
444
+ spindb create shop --engine mysql --db-version 9
445
+ spindb connect shop --mycli
579
446
 
580
- # Shorthand
581
- spindb backup mydb --sql
582
- spindb backup mydb --dump
447
+ # MariaDB (MySQL-compatible)
448
+ spindb create store --engine mariadb --db-version 11.8
583
449
  ```
584
450
 
585
- Format by engine:
586
- - PostgreSQL: `.sql` (plain SQL) / `.dump` (pg_dump custom)
587
- - MariaDB: `.sql` (plain SQL) / `.sql.gz` (compressed SQL)
588
- - MySQL: `.sql` (plain SQL) / `.sql.gz` (compressed SQL)
589
- - SQLite: `.sql` (plain SQL) / `.sqlite` (binary copy)
590
- - MongoDB: `.bson` (BSON dump) / `.archive` (compressed archive)
591
- - Redis: `.redis` (text commands) / `.rdb` (RDB snapshot)
592
- - Valkey: `.valkey` (text commands) / `.rdb` (RDB snapshot)
451
+ **MySQL versions:** 8.0, 8.4, 9
452
+ **MariaDB versions:** 10.11, 11.4, 11.8
453
+ **Tools:** `mysql`, `mysqldump`, `mysqladmin` (included)
593
454
 
594
- <details>
595
- <summary>All options</summary>
596
-
597
- | Option | Description |
598
- |--------|-------------|
599
- | `--database`, `-d` | Database to backup (defaults to primary) |
600
- | `--name`, `-n` | Custom backup filename (without extension) |
601
- | `--output`, `-o` | Output directory (defaults to current directory) |
602
- | `--format` | Output format: `sql` or `dump` |
603
- | `--sql` | Shorthand for `--format sql` |
604
- | `--dump` | Shorthand for `--format dump` |
605
- | `--json`, `-j` | Output result as JSON |
606
-
607
- </details>
608
-
609
- #### `backups` - List backup files
455
+ ### MongoDB 🍃
610
456
 
611
457
  ```bash
612
- spindb backups # List backups in current directory
613
- spindb backups ./data # List backups in specific directory
614
- spindb backups --all # Include ~/.spindb/backups
615
- spindb backups --limit 50 # Show more results
616
- spindb backups --json # JSON output
617
- ```
458
+ # Create MongoDB database
459
+ spindb create logs --engine mongodb --db-version 8.0
618
460
 
619
- <details>
620
- <summary>All options</summary>
461
+ # JavaScript queries (not SQL)
462
+ spindb run logs -c "db.users.insertOne({name: 'Alice'})"
463
+ spindb run logs -c "db.users.find().pretty()"
464
+ spindb run logs seed.js
621
465
 
622
- | Option | Description |
623
- |--------|-------------|
624
- | `--all`, `-a` | Include backups from `~/.spindb/backups` |
625
- | `--limit`, `-n` | Limit number of results (default: 20) |
626
- | `--json`, `-j` | Output as JSON |
466
+ # Connect with mongosh
467
+ spindb connect logs
468
+ ```
627
469
 
628
- </details>
470
+ **Versions:** 7.0, 8.0, 8.2
471
+ **Query language:** JavaScript (via `mongosh`)
472
+ **Tools:** `mongod`, `mongosh`, `mongodump`, `mongorestore` (included)
629
473
 
630
- #### `restore` - Restore from backup
474
+ ### Redis 🔴 & Valkey 🔷
631
475
 
632
476
  ```bash
633
- spindb restore mydb backup.dump
634
- spindb restore mydb backup.sql --database my_app
635
- spindb restore mydb --from-url "postgresql://user:pass@host/db"
636
- ```
477
+ # Redis
478
+ spindb create cache --engine redis --db-version 8
637
479
 
638
- **Restore production data alongside existing databases:**
639
-
640
- ```bash
641
- # Restore into a NEW database without affecting existing data
642
- spindb restore mydb prod-backup.dump --database prod_copy
480
+ # Valkey (Redis fork with BSD-3 license)
481
+ spindb create sessions --engine valkey --db-version 9
643
482
 
644
- # Pull from production into a new local database
645
- spindb restore mydb --from-url "postgresql://user:pass@prod-host/proddb" --database prod_local
483
+ # Redis commands
484
+ spindb run cache -c "SET mykey myvalue"
485
+ spindb run cache -c "GET mykey"
646
486
 
647
- # View all databases in a container
648
- spindb info mydb
487
+ # Enhanced shell
488
+ spindb connect cache --iredis
649
489
  ```
650
490
 
651
- <details>
652
- <summary>All options</summary>
653
-
654
- | Option | Description |
655
- |--------|-------------|
656
- | `--database`, `-d` | Target database name (creates new if doesn't exist) |
657
- | `--from-url` | Pull data from a remote database connection string |
658
- | `--force`, `-f` | Overwrite existing database without confirmation |
659
- | `--json`, `-j` | Output result as JSON |
660
-
661
- </details>
662
-
663
- #### Backup & Restore Format Reference
664
-
665
- Each engine has specific backup formats and restore behaviors:
666
-
667
- <details>
668
- <summary>PostgreSQL</summary>
669
-
670
- | Format | Extension | Tool | Notes |
671
- |--------|-----------|------|-------|
672
- | SQL | `.sql` | pg_dump | Plain text SQL, human-readable |
673
- | Custom | `.dump` | pg_dump -Fc | Compressed, supports parallel restore |
674
-
675
- **Restore behavior:** Creates new database or replaces existing. Uses `pg_restore` for `.dump`, `psql` for `.sql`.
676
-
677
- </details>
678
-
679
- <details>
680
- <summary>MariaDB</summary>
681
-
682
- | Format | Extension | Tool | Notes |
683
- |--------|-----------|------|-------|
684
- | SQL | `.sql` | mariadb-dump | Plain text SQL |
685
- | Compressed | `.sql.gz` | mariadb-dump + gzip | Gzip compressed SQL |
686
-
687
- **Restore behavior:** Creates new database or replaces existing. Pipes to `mariadb` client.
688
-
689
- </details>
690
-
691
- <details>
692
- <summary>MySQL</summary>
693
-
694
- | Format | Extension | Tool | Notes |
695
- |--------|-----------|------|-------|
696
- | SQL | `.sql` | mysqldump | Plain text SQL |
697
- | Compressed | `.sql.gz` | mysqldump + gzip | Gzip compressed SQL |
491
+ **Redis versions:** 7, 8
492
+ **Valkey versions:** 8, 9
493
+ **Query language:** Redis commands
494
+ **Databases:** Numbered 0-15 (not named)
495
+ **Tools:** `redis-cli`, `redis-server` / `valkey-cli`, `valkey-server` (included)
698
496
 
699
- **Restore behavior:** Creates new database or replaces existing. Pipes to `mysql` client.
497
+ ### SQLite 🪶 & DuckDB 🦆
700
498
 
701
- </details>
702
-
703
- <details>
704
- <summary>SQLite</summary>
705
-
706
- | Format | Extension | Tool | Notes |
707
- |--------|-----------|------|-------|
708
- | SQL | `.sql` | .dump | Plain text SQL |
709
- | Binary | `.sqlite` | File copy | Exact copy of database file |
710
-
711
- **Restore behavior:** Creates new file or replaces existing.
712
-
713
- </details>
714
-
715
- <details>
716
- <summary>MongoDB</summary>
717
-
718
- | Format | Extension | Tool | Notes |
719
- |--------|-----------|------|-------|
720
- | BSON | `.bson` | mongodump | Binary JSON per collection |
721
- | Archive | `.archive` | mongodump --archive | Single compressed file |
722
-
723
- **Restore behavior:** Creates new database or replaces existing. Uses `mongorestore`.
724
-
725
- </details>
726
-
727
- <details>
728
- <summary>Redis</summary>
729
-
730
- | Format | Extension | Tool | Notes |
731
- |--------|-----------|------|-------|
732
- | RDB | `.rdb` | BGSAVE | Binary snapshot, requires restart |
733
- | Text | `.redis` | Custom | Human-readable Redis commands |
734
-
735
- **Text format detection:** Files are detected as Redis text commands if they contain valid Redis commands (SET, HSET, DEL, etc.), regardless of file extension. This allows restoring files like `users.txt` or `data` without renaming.
499
+ ```bash
500
+ # SQLite - embedded relational database
501
+ spindb create app --engine sqlite --path ./data/app.sqlite
502
+ spindb connect app
736
503
 
737
- **Restore behavior:**
738
- - **RDB (`.rdb`):** Requires stopping Redis, copies file to data directory, restart loads data
739
- - **Text (`.redis`):** Pipes commands to running Redis instance. Prompts for:
740
- - **Replace all:** Runs `FLUSHDB` first (clean slate)
741
- - **Merge:** Adds/updates keys, keeps existing keys not in backup
504
+ # DuckDB - embedded analytics database (OLAP)
505
+ spindb create analytics --engine duckdb --path ./data/warehouse.duckdb
506
+ spindb connect analytics
507
+ ```
742
508
 
743
- **Note:** Redis uses numbered databases (0-15) that always exist. "Create new database" is not applicable.
509
+ **No server process** - File-based databases stored in your project directories.
510
+ **No start/stop needed** - Always "running" (embedded).
511
+ **SQLite tools:** `sqlite3`, `sqldiff`, `sqlite3_analyzer` (included)
512
+ **DuckDB tools:** `duckdb` (included)
744
513
 
745
- </details>
514
+ ### ClickHouse 🏠
746
515
 
747
- <details>
748
- <summary>Valkey</summary>
516
+ ```bash
517
+ # Create ClickHouse database (columnar OLAP)
518
+ spindb create warehouse --engine clickhouse
749
519
 
750
- | Format | Extension | Tool | Notes |
751
- |--------|-----------|------|-------|
752
- | RDB | `.rdb` | BGSAVE | Binary snapshot, requires restart |
753
- | Text | `.valkey` | Custom | Human-readable Redis-compatible commands |
520
+ # SQL with ClickHouse extensions
521
+ spindb run warehouse -c "CREATE TABLE events (timestamp DateTime, user_id UInt64) ENGINE = MergeTree() ORDER BY timestamp"
522
+ spindb run warehouse -c "SELECT * FROM system.tables"
523
+ ```
754
524
 
755
- **Text format detection:** Files are detected as Valkey text commands if they contain valid Redis commands (SET, HSET, DEL, etc.), regardless of file extension.
525
+ **Version:** 25.12 (YY.MM versioning)
526
+ **Platforms:** macOS, Linux (no Windows support)
527
+ **Ports:** 9000 (native TCP), 8123 (HTTP)
528
+ **Tools:** `clickhouse-client`, `clickhouse-server` (included)
756
529
 
757
- **Restore behavior:** Same as Redis (Valkey is Redis-compatible).
758
- - **RDB (`.rdb`):** Requires stopping Valkey, copies file to data directory, restart loads data
759
- - **Text (`.valkey`):** Pipes commands to running Valkey instance. Prompts for:
760
- - **Replace all:** Runs `FLUSHDB` first (clean slate)
761
- - **Merge:** Adds/updates keys, keeps existing keys not in backup
530
+ ---
762
531
 
763
- **Note:** Valkey uses numbered databases (0-15) that always exist. "Create new database" is not applicable.
532
+ ## Enhanced CLI Tools
764
533
 
765
- </details>
534
+ SpinDB supports enhanced database shells with auto-completion, syntax highlighting, and better formatting:
766
535
 
767
- ### Container Management
536
+ | Engine | Standard Client | Enhanced Client | Universal Client |
537
+ |--------|----------------|-----------------|------------------|
538
+ | PostgreSQL | `psql` | `pgcli` | `usql` |
539
+ | MySQL | `mysql` | `mycli` | `usql` |
540
+ | MariaDB | `mariadb` | `mycli` | `usql` |
541
+ | SQLite | `sqlite3` | `litecli` | `usql` |
542
+ | DuckDB | `duckdb` | - | `usql` |
543
+ | MongoDB | `mongosh` | - | - |
544
+ | Redis | `redis-cli` | `iredis` | - |
545
+ | Valkey | `valkey-cli` | `iredis` (compatible) | - |
546
+ | ClickHouse | `clickhouse-client` | - | `usql` |
768
547
 
769
- #### `list` - List all containers
548
+ Install and use in one command:
770
549
 
771
550
  ```bash
772
- spindb list
773
- spindb list --json
551
+ spindb connect mydb --install-pgcli
552
+ spindb connect mydb --install-mycli
553
+ spindb connect mydb --install-tui # usql (universal)
774
554
  ```
775
555
 
776
- #### `info` - Show container details
556
+ ---
777
557
 
778
- ```bash
779
- spindb info # All containers
780
- spindb info mydb # Specific container
781
- spindb info mydb --json
782
- ```
558
+ ## Backup & Restore
783
559
 
784
- #### `clone` - Clone a container
560
+ Every engine supports backup and restore with engine-specific formats:
785
561
 
786
- ```bash
787
- spindb stop source-db # Source must be stopped
788
- spindb clone source-db new-db
789
- spindb start new-db
790
- ```
562
+ ### PostgreSQL
791
563
 
792
- #### `edit` - Rename, change port, relocate, or edit database config
564
+ | Format | Extension | Tool | Use Case |
565
+ |--------|-----------|------|----------|
566
+ | SQL | `.sql` | pg_dump | Human-readable, portable |
567
+ | Custom | `.dump` | pg_dump -Fc | Compressed, faster restore |
793
568
 
794
569
  ```bash
795
- spindb edit mydb --name newname # Must be stopped
796
- spindb edit mydb --port 5433
797
- spindb edit mydb --relocate ~/new/path # Move SQLite database file
798
- spindb edit mydb --set-config max_connections=300 # PostgreSQL config
799
- spindb edit mydb # Interactive mode
570
+ spindb backup mydb --sql # Plain SQL
571
+ spindb backup mydb --dump # Binary custom format
572
+ spindb restore mydb backup.dump
800
573
  ```
801
574
 
802
- #### `logs` - View container logs
575
+ ### MySQL & MariaDB
576
+
577
+ | Format | Extension | Tool | Use Case |
578
+ |--------|-----------|------|----------|
579
+ | SQL | `.sql` | mysqldump / mariadb-dump | Human-readable |
580
+ | Compressed | `.sql.gz` | mysqldump + gzip | Smaller file size |
803
581
 
804
582
  ```bash
805
- spindb logs mydb
806
- spindb logs mydb --follow # Follow mode (like tail -f)
807
- spindb logs mydb -n 50 # Last 50 lines
808
- spindb logs mydb --editor # Open in $EDITOR
583
+ spindb backup mydb --sql # Plain SQL
584
+ spindb backup mydb --dump # Compressed SQL
809
585
  ```
810
586
 
811
- ### Engine & System
587
+ ### MongoDB
812
588
 
813
- #### `engines` - Manage installed engines
589
+ | Format | Extension | Tool | Use Case |
590
+ |--------|-----------|------|----------|
591
+ | BSON | `.bson` | mongodump | Binary, preserves all types |
592
+ | Archive | `.archive` | mongodump --archive | Single compressed file |
814
593
 
815
594
  ```bash
816
- spindb engines # List installed engines
817
- spindb engines list --json # JSON output
818
- spindb engines supported # List all supported engines
819
- spindb engines supported --json # Full engine config as JSON
820
- spindb engines supported --all # Include pending/planned engines
821
- spindb engines delete postgresql 16 # Delete a version (frees ~45MB)
595
+ spindb backup mydb # BSON directory
596
+ spindb backup mydb --format archive # Single .archive file
822
597
  ```
823
598
 
824
- Example output:
599
+ ### Redis & Valkey
825
600
 
826
- ```
827
- ENGINE VERSION SOURCE SIZE
828
- ────────────────────────────────────────────────────────
829
- 🐘 postgresql 18.1 darwin-arm64 46.0 MB
830
- 🐘 postgresql 17.7 darwin-arm64 45.2 MB
831
- 🐬 mysql 9.0.1 darwin-arm64 150.0 MB
832
- 🪶 sqlite 3.51.2 darwin-arm64 5.0 MB
833
- ────────────────────────────────────────────────────────
834
-
835
- PostgreSQL: 2 version(s), 90.0 MB
836
- MySQL: 1 version(s), 150.0 MB
837
- SQLite: 1 version(s), 5.0 MB
838
- ```
601
+ | Format | Extension | Tool | Use Case |
602
+ |--------|-----------|------|----------|
603
+ | RDB | `.rdb` | BGSAVE | Binary snapshot, requires restart |
604
+ | Text | `.redis` / `.valkey` | Custom | Human-readable commands |
839
605
 
840
- `spindb engines supported` output:
606
+ ```bash
607
+ spindb backup mydb --dump # RDB snapshot
608
+ spindb backup mydb --sql # Text commands
841
609
 
842
- ```
843
- 🐘 postgresql
844
- 🐬 mysql
845
- 🦭 mariadb
846
- 🪶 sqlite
847
- 🍃 mongodb
848
- 🔴 redis
849
- 🔷 valkey
610
+ # Restore with merge or replace strategy
611
+ spindb restore mydb backup.redis # Prompts: Replace all / Merge
850
612
  ```
851
613
 
852
- #### `deps` - Manage client tools
614
+ ### SQLite & DuckDB
853
615
 
854
- ```bash
855
- spindb deps check # Check all dependencies
856
- spindb deps check --engine postgresql # Check specific engine
857
- spindb deps install # Install missing tools
858
- spindb deps install --engine mysql # Install for specific engine
859
- ```
860
-
861
- #### `config` - Configuration
616
+ | Format | Extension | Tool | Use Case |
617
+ |--------|-----------|------|----------|
618
+ | SQL | `.sql` | .dump / duckdb | Human-readable |
619
+ | Binary | `.sqlite` / `.duckdb` | File copy | Exact database copy |
862
620
 
863
621
  ```bash
864
- spindb config show # Show current configuration
865
- spindb config detect # Re-detect tool paths
866
- spindb config update-check on # Enable update notifications
867
- spindb config update-check off # Disable update notifications
622
+ spindb backup mydb --sql # SQL dump
623
+ spindb backup mydb --dump # Binary copy
868
624
  ```
869
625
 
870
- #### `version` - Version info
626
+ ### ClickHouse
871
627
 
872
- ```bash
873
- spindb version
874
- spindb version --check # Check for updates
875
- ```
876
-
877
- #### `self-update` - Update SpinDB
628
+ | Format | Extension | Tool | Use Case |
629
+ |--------|-----------|------|----------|
630
+ | SQL | `.sql` | clickhouse-client | Plain SQL dump |
631
+ | Native | `.clickhouse` | clickhouse-backup | Native format (future) |
878
632
 
879
633
  ```bash
880
- spindb self-update
634
+ spindb backup mydb --sql # SQL dump
881
635
  ```
882
636
 
883
- #### `doctor` - System health check
637
+ ---
884
638
 
885
- ```bash
886
- spindb doctor # Interactive health check
887
- spindb doctor --json # JSON output for scripting
888
- ```
639
+ ## Advanced Features
889
640
 
890
- Checks performed:
891
- - Configuration file validity and binary cache freshness
892
- - Container status across all engines
893
- - SQLite registry for orphaned entries (files deleted outside SpinDB)
894
- - Database tool availability
641
+ ### Clone Databases
895
642
 
896
- Example output:
643
+ Create exact copies of existing databases:
897
644
 
645
+ ```bash
646
+ # Clone local database (must be stopped)
647
+ spindb stop production
648
+ spindb clone production staging
649
+ spindb start production
650
+ spindb start staging
898
651
  ```
899
- SpinDB Health Check
900
- ═══════════════════
901
652
 
902
- Configuration
903
- └─ Configuration valid, 12 tools cached
653
+ ### Restore from Remote
904
654
 
905
- Containers
906
- └─ 4 container(s)
907
- postgresql: 2 running, 0 stopped
908
- mysql: 0 running, 1 stopped
909
- sqlite: 1 exist, 0 missing
655
+ Pull production data into local databases:
910
656
 
911
- ⚠ SQLite Registry
912
- └─ 1 orphaned entry found
913
- "old-project" /path/to/missing.sqlite
657
+ ```bash
658
+ # Create new database from remote
659
+ spindb create prod-copy --from "postgresql://user:pass@prod-host:5432/production"
914
660
 
915
- ? What would you like to do?
916
- Remove orphaned entries from registry
917
- Skip (do nothing)
661
+ # Or restore into existing database
662
+ spindb restore mydb --from-url "postgresql://user:pass@prod-host:5432/production"
918
663
  ```
919
664
 
920
- ---
665
+ ### Multi-Version Support
921
666
 
922
- ## Enhanced CLI Tools
667
+ Run different versions of the same database simultaneously:
923
668
 
924
- SpinDB supports enhanced database shells that provide features like auto-completion, syntax highlighting, and better output formatting.
669
+ ```bash
670
+ # PostgreSQL 14 for legacy app
671
+ spindb create legacy-api --engine postgresql --db-version 14 --port 5432
925
672
 
926
- | Engine | Standard | Enhanced | Universal |
927
- |--------|----------|----------|-----------|
928
- | PostgreSQL | `psql` | `pgcli` | `usql` |
929
- | MariaDB | `mariadb` | `mycli` | `usql` |
930
- | MySQL | `mysql` | `mycli` | `usql` |
931
- | SQLite | `sqlite3` | `litecli` | `usql` |
932
- | MongoDB | `mongosh` | - | `usql` |
933
- | Redis | `redis-cli` | `iredis` | - |
934
- | Valkey | `valkey-cli` | `iredis` | - |
673
+ # PostgreSQL 18 for new app
674
+ spindb create modern-api --engine postgresql --db-version 18 --port 5433
935
675
 
936
- **pgcli / mycli** provide:
937
- - Intelligent auto-completion (tables, columns, keywords)
938
- - Syntax highlighting
939
- - Multi-line editing
940
- - Query history with search
676
+ # Both running at the same time
677
+ spindb list
678
+ # NAME ENGINE VERSION PORT STATUS
679
+ # legacy-api postgresql 14 5432 running
680
+ # modern-api postgresql 18 5433 running
681
+ ```
941
682
 
942
- **usql** is a universal SQL client that works with any database. Great if you work with multiple engines.
683
+ ### Custom Ports
943
684
 
944
- Install and connect in one command:
685
+ SpinDB auto-assigns ports, but you can override:
945
686
 
946
687
  ```bash
947
- spindb connect mydb --install-pgcli
948
- spindb connect mydb --install-mycli
949
- spindb connect mydb --install-tui # usql
688
+ spindb create mydb --port 5433
689
+ spindb edit mydb --port 5434 # Change later
950
690
  ```
951
691
 
952
- ---
953
-
954
- ## Architecture
955
-
956
- ### How It Works
957
-
958
- SpinDB uses the term "container" loosely—there's no Docker involved. When you create a container, SpinDB:
692
+ ### SQLite & DuckDB Registry
959
693
 
960
- 1. Downloads the database server binary (or uses your system's installation)
961
- 2. Creates an isolated data directory at `~/.spindb/containers/{engine}/{name}/`
962
- 3. Runs the database as a native process on your machine
694
+ File-based databases can be registered for easy access:
963
695
 
964
- Each "container" is just:
965
- - A configuration file (`container.json`)
966
- - A data directory (`data/`)
967
- - A log file (`postgres.log`, `mysql.log`, or `mongodb.log`)
696
+ ```bash
697
+ # Create and register
698
+ spindb create mydb --engine sqlite --path ./data/app.sqlite
968
699
 
969
- Native processes mean instant startup and no virtualization overhead.
700
+ # Attach existing database
701
+ spindb attach ./existing/data.sqlite --name legacy-db
970
702
 
971
- ### Storage Layout
972
-
973
- ```
974
- ~/.spindb/
975
- ├── bin/ # Downloaded server binaries
976
- │ └── postgresql-18.1.0-darwin-arm64/ # ~45 MB per version
977
- ├── containers/
978
- │ ├── postgresql/
979
- │ │ └── mydb/
980
- │ │ ├── container.json # Configuration
981
- │ │ ├── data/ # Database files
982
- │ │ └── postgres.log # Server logs
983
- │ └── mysql/
984
- │ └── mydb/
985
- │ ├── container.json
986
- │ ├── data/
987
- │ └── mysql.log
988
- ├── logs/ # Error logs
989
- └── config.json # Tool paths cache
990
-
991
- # SQLite databases are stored in project directories, not ~/.spindb/
992
- ./myproject/
993
- └── mydb.sqlite # Created with: spindb create mydb -e sqlite
703
+ # Detach (removes from registry, keeps file)
704
+ spindb detach legacy-db
994
705
  ```
995
706
 
996
- ### Data Persistence
997
-
998
- SpinDB runs databases as **native processes** on your machine. When you start a container:
999
-
1000
- 1. SpinDB launches the database server binary (`pg_ctl start` or `mysqld`)
1001
- 2. The server binds to `127.0.0.1` on your configured port
1002
- 3. A PID file tracks the running process
1003
- 4. Logs are written to the container's log file
1004
-
1005
- When you stop a container:
1006
-
1007
- 1. SpinDB sends a graceful shutdown signal
1008
- 2. The database flushes pending writes to disk
1009
- 3. The PID file is removed
1010
- 4. Your data remains in the `data/` directory
1011
-
1012
- **Your data is never deleted unless you explicitly delete the container.**
1013
-
1014
- #### Persistence by Engine
1015
-
1016
- Each database engine has its own persistence mechanism:
1017
-
1018
- | Engine | Mechanism | Durability |
1019
- |--------|-----------|------------|
1020
- | PostgreSQL | Write-Ahead Logging (WAL) | Every commit is immediately durable |
1021
- | MariaDB | InnoDB transaction logs | Every commit is immediately durable |
1022
- | MySQL | InnoDB transaction logs | Every commit is immediately durable |
1023
- | SQLite | File-based transactions | Every commit is immediately durable |
1024
- | MongoDB | WiredTiger with journaling | Writes journaled before acknowledged |
1025
- | Redis | RDB snapshots | Periodic snapshots (see below) |
1026
-
1027
- **PostgreSQL, MariaDB, MySQL, MongoDB:** These engines use transaction logs or journaling. Every committed write is guaranteed to survive a crash or unexpected shutdown.
1028
-
1029
- **SQLite:** As a file-based database, SQLite writes directly to disk on each commit. No server process means no risk of losing in-flight data.
1030
-
1031
- **Redis:** SpinDB configures Redis with RDB (Redis Database) snapshots:
1032
- - Save after 900 seconds if at least 1 key changed
1033
- - Save after 300 seconds if at least 10 keys changed
1034
- - Save after 60 seconds if at least 10,000 keys changed
1035
-
1036
- This means Redis may lose up to ~60 seconds of writes on an unexpected crash. For local development, this trade-off (speed over strict durability) is typically acceptable. If you need stronger guarantees, use `spindb backup` before stopping work.
1037
-
1038
- ### Binary Sources
1039
-
1040
- **PostgreSQL:** Server binaries are downloaded automatically:
1041
- - **macOS/Linux:** From [hostdb](https://github.com/robertjbass/hostdb) on GitHub Releases
1042
- - **Windows:** From [EnterpriseDB (EDB)](https://www.enterprisedb.com/download-postgresql-binaries)
1043
-
1044
- **MariaDB, MySQL, MongoDB, Redis, Valkey:** Server binaries are downloaded automatically from [hostdb](https://github.com/robertjbass/hostdb) on GitHub Releases for all platforms.
1045
-
1046
- ### Why Precompiled Binaries?
1047
-
1048
- The [hostdb](https://github.com/robertjbass/hostdb) project provides pre-compiled, portable database binaries:
1049
-
1050
- - Cross-platform (macOS Intel/ARM, Linux x64/ARM, Windows x64)
1051
- - Hosted on GitHub Releases (highly reliable CDN)
1052
- - ~45-200 MB per version depending on engine
1053
- - Actively maintained with new database releases
1054
-
1055
- This makes multi-version support trivial: need PostgreSQL 14 for a legacy project and 18 for a new one? Need MongoDB 7.0 and 8.0? Redis 7 and 8? SpinDB downloads them all, and they run side-by-side without conflicts.
1056
-
1057
- ---
1058
-
1059
- ## Limitations
1060
-
1061
- - **Local only** - Databases bind to `127.0.0.1`; remote connections planned for v1.1
1062
- - **Redis remote dump not supported** - Redis doesn't support creating containers from remote connection strings. Use backup/restore for data migration.
1063
-
1064
707
  ---
1065
708
 
1066
709
  ## Roadmap
1067
710
 
1068
- See [TODO.md](TODO.md) for the full roadmap.
711
+ See [TODO.md](TODO.md) for the complete roadmap.
1069
712
 
1070
713
  ### v1.1 - Remote Connections & Secrets
1071
- - Connect to remote databases
714
+ - Direct remote database connections (`spindb connect --remote`)
1072
715
  - Environment variable support in connection strings
1073
- - Secrets management (macOS Keychain)
716
+ - Secrets management with macOS Keychain integration
1074
717
 
1075
718
  ### v1.2 - Additional Engines
1076
- - CockroachDB (distributed SQL)
719
+ - **CockroachDB** - Distributed PostgreSQL-compatible database
720
+ - **FerretDB** - MongoDB-compatible database built on PostgreSQL
1077
721
 
1078
722
  ### v1.3 - Advanced Features
1079
- - Container templates
1080
- - Scheduled backups
1081
- - Import from Docker
1082
-
1083
- ### Future Infrastructure
1084
- - **hostdb npm package**: Available database versions will be published as an npm package from [hostdb](https://github.com/robertjbass/hostdb) and imported into SpinDB, eliminating the need to manually sync version-maps.ts with releases.json
1085
- - **pnpm 10 upgrade**: Currently pinned to pnpm 9.x (`packageManager` in package.json and Docker). Consider upgrading to pnpm 10.x when stable—requires updating package.json, Dockerfile, regenerating pnpm-lock.yaml, and testing for lockfile format changes
723
+ - Container templates for common configurations
724
+ - Scheduled automated backups
725
+ - Import databases from Docker containers
1086
726
 
1087
- ### Possible Future Engines
727
+ ### Future Engines Under Consideration
1088
728
 
1089
- These engines are under consideration but not yet on the roadmap. Community interest and feasibility will determine priority:
729
+ The following engines may be added based on community interest:
1090
730
 
1091
731
  | Engine | Type | Notes |
1092
732
  |--------|------|-------|
1093
- | **DuckDB** | Embedded analytical | File-based like SQLite, popular for data/analytics work |
1094
- | **libSQL** | Embedded relational | SQLite fork by Turso with replication and edge support |
1095
- | **Meilisearch** | Search engine | Developer-friendly search, good binary distribution |
1096
- | **Elasticsearch/OpenSearch** | Search engine | Full-text search, common in web applications |
1097
- | **Neo4j** | Graph database | Most popular graph database |
1098
- | **InfluxDB** | Time-series | IoT, metrics, and monitoring use cases |
733
+ | **libSQL** | Embedded relational | SQLite fork with replication |
734
+ | **Meilisearch** | Search engine | Developer-friendly full-text search |
735
+ | **OpenSearch** | Search engine | Elasticsearch alternative |
736
+ | **InfluxDB** | Time-series | Metrics and IoT data |
737
+ | **Neo4j** | Graph database | Relationships and network data |
738
+
739
+ ---
740
+
741
+ ## Limitations
742
+
743
+ - **Local only** - Databases bind to `127.0.0.1`. Remote connection support planned for v1.1.
744
+ - **ClickHouse Windows** - Not supported (hostdb doesn't build for Windows).
745
+ - **Redis/Valkey remote dump** - Cannot create containers directly from remote connection strings. Use backup/restore workflow instead.
1099
746
 
1100
747
  ---
1101
748
 
1102
749
  ## Troubleshooting
1103
750
 
1104
- ### Port already in use
751
+ ### Port Already in Use
1105
752
 
1106
- SpinDB automatically finds an available port. To specify one:
753
+ SpinDB automatically finds available ports, but you can specify:
1107
754
 
1108
755
  ```bash
1109
756
  spindb create mydb --port 5433
1110
757
  ```
1111
758
 
1112
- ### Client tool not found
759
+ ### Container Won't Start
1113
760
 
1114
- Install client tools or configure manually:
761
+ Check the logs:
1115
762
 
1116
763
  ```bash
1117
- spindb deps install
764
+ spindb logs mydb
1118
765
  # or
1119
- spindb config set psql /path/to/psql
766
+ cat ~/.spindb/containers/postgresql/mydb/postgres.log
1120
767
  ```
1121
768
 
1122
- ### Container won't start
769
+ ### Client Tool Not Found
1123
770
 
1124
- Check the logs:
771
+ Install dependencies:
1125
772
 
1126
773
  ```bash
1127
- spindb logs mydb
1128
- # or read directly
1129
- cat ~/.spindb/containers/postgresql/mydb/postgres.log
774
+ spindb deps install
775
+ spindb deps check
1130
776
  ```
1131
777
 
1132
- ### Reset everything
778
+ ### Binary Download Fails
779
+
780
+ SpinDB downloads from [hostdb GitHub Releases](https://github.com/robertjbass/hostdb/releases). If downloads fail:
781
+
782
+ 1. Check your internet connection
783
+ 2. Verify GitHub isn't blocked by your firewall
784
+ 3. Try again (SpinDB has automatic retry logic)
785
+
786
+ ### Reset Everything
1133
787
 
1134
788
  ```bash
1135
789
  rm -rf ~/.spindb
1136
790
  ```
1137
791
 
792
+ This deletes all containers, binaries, and configuration. Use with caution.
793
+
1138
794
  ---
1139
795
 
1140
796
  ## Contributing
1141
797
 
1142
- Note: This repo currently assumes `pnpm` for running tests. `npm test` will shell out to `pnpm` and fail if `pnpm` isn't installed.
798
+ We welcome contributions! SpinDB is built with:
1143
799
 
1144
- See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, testing, and distribution info.
800
+ - **Runtime:** Node.js 18+ with TypeScript
801
+ - **Execution:** `tsx` for direct TypeScript execution
802
+ - **Package Manager:** pnpm (strictly enforced)
803
+ - **CLI Framework:** Commander.js
804
+ - **Interactive UI:** Inquirer.js, Chalk, Ora
1145
805
 
1146
- See [ARCHITECTURE.md](ARCHITECTURE.md) for project architecture and comprehensive CLI command examples.
806
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and testing guidelines.
807
+
808
+ See [ARCHITECTURE.md](ARCHITECTURE.md) for project architecture details.
1147
809
 
1148
810
  See [CLAUDE.md](CLAUDE.md) for AI-assisted development context.
1149
811
 
1150
- See [ENGINES.md](ENGINES.md) for detailed engine documentation (backup formats, planned engines, etc.).
812
+ See [FEATURE.md](FEATURE.md) for adding new database engines.
1151
813
 
1152
814
  ---
1153
815
 
1154
816
  ## Acknowledgments
1155
817
 
1156
- SpinDB wouldn't be possible without:
818
+ SpinDB is powered by:
1157
819
 
1158
- - **[hostdb](https://github.com/robertjbass/hostdb)** - Pre-compiled database binaries (PostgreSQL, MySQL, MariaDB, MongoDB, Redis, Valkey, SQLite) that make Docker-free local databases possible. Hosted on GitHub Releases for reliable, fast downloads.
820
+ - **[hostdb](https://github.com/robertjbass/hostdb)** - Pre-compiled database binaries for 9 engines across all major platforms. Makes Docker-free multi-version database support possible.
1159
821
 
1160
822
  ---
1161
823
 
@@ -1163,9 +825,26 @@ SpinDB wouldn't be possible without:
1163
825
 
1164
826
  [PolyForm Noncommercial 1.0.0](LICENSE)
1165
827
 
1166
- SpinDB is free for:
828
+ SpinDB is **free** for:
1167
829
  - Personal use and hobby projects
1168
- - Educational and research purposes
1169
- - Nonprofit organizations, educational institutions, and government
830
+ - Educational institutions and students
831
+ - Academic and scientific research
832
+ - Nonprofit organizations
833
+ - Government agencies
834
+
835
+ **Commercial use requires a separate license.** For commercial licensing inquiries, please open an issue or contact the maintainer.
836
+
837
+ ---
838
+
839
+ ## Links
840
+
841
+ - **GitHub:** [github.com/robertjbass/spindb](https://github.com/robertjbass/spindb)
842
+ - **npm:** [npmjs.com/package/spindb](https://www.npmjs.com/package/spindb)
843
+ - **hostdb:** [github.com/robertjbass/hostdb](https://github.com/robertjbass/hostdb)
844
+ - **Issues:** [github.com/robertjbass/spindb/issues](https://github.com/robertjbass/spindb/issues)
845
+
846
+ ---
847
+
848
+ **Questions? Found a bug? Have a feature request?**
1170
849
 
1171
- **SpinDB may not be used for commercial purposes.**
850
+ Open an issue: [github.com/robertjbass/spindb/issues](https://github.com/robertjbass/spindb/issues)