spindb 0.1.0 → 0.2.1
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.
- package/README.md +24 -3
- package/package.json +10 -2
- package/src/cli/commands/create.ts +23 -3
- package/src/cli/commands/menu.ts +955 -142
- package/src/cli/commands/postgres-tools.ts +216 -0
- package/src/cli/commands/restore.ts +28 -0
- package/src/cli/index.ts +2 -0
- package/src/cli/ui/prompts.ts +111 -21
- package/src/cli/ui/theme.ts +54 -10
- package/src/config/defaults.ts +6 -3
- package/src/core/binary-manager.ts +42 -12
- package/src/core/container-manager.ts +53 -5
- package/src/core/port-manager.ts +76 -1
- package/src/core/postgres-binary-manager.ts +499 -0
- package/src/core/process-manager.ts +4 -4
- package/src/engines/base-engine.ts +22 -0
- package/src/engines/postgresql/binary-urls.ts +130 -12
- package/src/engines/postgresql/index.ts +40 -4
- package/src/engines/postgresql/restore.ts +20 -9
- package/src/types/index.ts +15 -13
- package/tsconfig.json +6 -3
- package/.claude/settings.local.json +0 -20
- package/.env.example +0 -1
- package/.prettierignore +0 -4
- package/.prettierrc +0 -6
- package/CLAUDE.md +0 -162
- package/TODO.md +0 -66
- package/eslint.config.js +0 -18
- package/seeds/mysql/sample-db.sql +0 -22
- package/seeds/postgres/sample-db.sql +0 -27
package/TODO.md
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
# SpinDB TODO
|
|
2
|
-
|
|
3
|
-
## Monetization Model
|
|
4
|
-
|
|
5
|
-
Similar to ngrok - free tier for individual developers with core functionality, paid tiers for power users and teams.
|
|
6
|
-
|
|
7
|
-
- **Free**: Full local dev experience, unlimited containers, basic backup/restore
|
|
8
|
-
- **Pro** ($X/month): Security features, multi-engine support, advanced features
|
|
9
|
-
- **Team** ($X/user/month): Shared configs, team collaboration, priority support
|
|
10
|
-
|
|
11
|
-
## Free Features
|
|
12
|
-
|
|
13
|
-
### High Priority
|
|
14
|
-
- [ ] **Run SQL file** - Add menu option to run a `.sql` file against a container (wrapper around `psql -f`)
|
|
15
|
-
- [ ] **Backup command** - Add `spindb backup` to create dumps using `pg_dump`
|
|
16
|
-
- [ ] **Logs command** - Add `spindb logs <container>` to tail `postgres.log`
|
|
17
|
-
- [ ] **Engine/binary management** - Menu to list installed PostgreSQL versions, install new versions, uninstall unused versions (free up disk space)
|
|
18
|
-
|
|
19
|
-
### Medium Priority
|
|
20
|
-
- [ ] **Container rename** - Rename a container without cloning/deleting
|
|
21
|
-
- [ ] **Export connection string** - Copy connection string to clipboard
|
|
22
|
-
- [ ] **Multiple databases per container** - List/create/delete databases within a container
|
|
23
|
-
|
|
24
|
-
### Low Priority
|
|
25
|
-
- [ ] **SQLite support** - Add SQLite engine
|
|
26
|
-
- [ ] **Health checks** - Periodic connection tests to verify containers are responsive
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
## Paid Features (Pro)
|
|
31
|
-
|
|
32
|
-
### Security
|
|
33
|
-
- [ ] **Password support** - Set password on container creation, modify `pg_hba.conf` for password auth
|
|
34
|
-
- [ ] **Encrypted backups** - Encrypt dumps with password using gpg/openssl
|
|
35
|
-
|
|
36
|
-
### Multi-Engine Support
|
|
37
|
-
- [ ] **MySQL support** - Add MySQL engine (needs binary source)
|
|
38
|
-
- [ ] **MongoDB support** - Add MongoDB engine
|
|
39
|
-
|
|
40
|
-
### Advanced Features
|
|
41
|
-
- [ ] **Container templates** - Save container configs as reusable templates
|
|
42
|
-
- [ ] **Import from Docker** - Import data from Docker PostgreSQL containers
|
|
43
|
-
- [ ] **Automatic binary updates** - Check for and download newer PostgreSQL versions
|
|
44
|
-
- [ ] **Custom superuser name** - Allow changing from default `postgres` user
|
|
45
|
-
- [ ] **Scheduled backups** - Cron-like backup scheduling
|
|
46
|
-
- [ ] **Cloud backup sync** - Sync backups to S3/GCS/Azure
|
|
47
|
-
|
|
48
|
-
### Team Features
|
|
49
|
-
- [ ] **Shared configs** - Export/import container configs for team sharing
|
|
50
|
-
- [ ] **Config profiles** - Dev/staging/test profiles with different settings
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
## Stretch Goals
|
|
55
|
-
|
|
56
|
-
- [ ] **Terminal-based IDE** - Full TUI (terminal UI) for browsing tables, running queries, viewing results, editing data inline (think `lazygit` but for databases)
|
|
57
|
-
- Potential libraries: [blessed](https://github.com/chjj/blessed), [ink](https://github.com/vadimdemedes/ink), [terminal-kit](https://github.com/cronvel/terminal-kit)
|
|
58
|
-
- Inspiration: `lazygit`, `k9s`, `pgcli`
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
## Known Limitations
|
|
63
|
-
|
|
64
|
-
- **No Windows support** - zonky.io doesn't provide Windows binaries
|
|
65
|
-
- **Client tools required** - psql/pg_dump/pg_restore must be installed separately (not bundled)
|
|
66
|
-
- **Local only** - No remote connection support (binds to 127.0.0.1)
|
package/eslint.config.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import eslint from '@eslint/js'
|
|
2
|
-
import tseslint from 'typescript-eslint'
|
|
3
|
-
|
|
4
|
-
export default tseslint.config(
|
|
5
|
-
eslint.configs.recommended,
|
|
6
|
-
...tseslint.configs.recommended,
|
|
7
|
-
{
|
|
8
|
-
ignores: ['dist/', 'node_modules/', 'bin/'],
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
rules: {
|
|
12
|
-
'@typescript-eslint/no-unused-vars': [
|
|
13
|
-
'error',
|
|
14
|
-
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
|
|
15
|
-
],
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
)
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
-- Sample database schema for testing SpinDB
|
|
2
|
-
-- Creates a basic users table with common fields (MySQL syntax)
|
|
3
|
-
|
|
4
|
-
CREATE TABLE IF NOT EXISTS users (
|
|
5
|
-
id INT AUTO_INCREMENT PRIMARY KEY,
|
|
6
|
-
first_name VARCHAR(100) NOT NULL,
|
|
7
|
-
last_name VARCHAR(100) NOT NULL,
|
|
8
|
-
email VARCHAR(255) NOT NULL UNIQUE,
|
|
9
|
-
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
10
|
-
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
11
|
-
deleted_at TIMESTAMP NULL,
|
|
12
|
-
INDEX idx_users_email (email),
|
|
13
|
-
INDEX idx_users_deleted_at (deleted_at)
|
|
14
|
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
15
|
-
|
|
16
|
-
-- Sample data
|
|
17
|
-
INSERT IGNORE INTO users (first_name, last_name, email) VALUES
|
|
18
|
-
('Alice', 'Johnson', 'alice@example.com'),
|
|
19
|
-
('Bob', 'Smith', 'bob@example.com'),
|
|
20
|
-
('Charlie', 'Williams', 'charlie@example.com'),
|
|
21
|
-
('Diana', 'Brown', 'diana@example.com'),
|
|
22
|
-
('Eve', 'Davis', 'eve@example.com');
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
-- Sample database schema for testing SpinDB
|
|
2
|
-
-- Creates a basic users table with common fields
|
|
3
|
-
|
|
4
|
-
CREATE TABLE IF NOT EXISTS users (
|
|
5
|
-
id SERIAL PRIMARY KEY,
|
|
6
|
-
first_name VARCHAR(100) NOT NULL,
|
|
7
|
-
last_name VARCHAR(100) NOT NULL,
|
|
8
|
-
email VARCHAR(255) NOT NULL UNIQUE,
|
|
9
|
-
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
|
|
10
|
-
updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
|
|
11
|
-
deleted_at TIMESTAMP WITH TIME ZONE
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
-- Create an index on email for faster lookups
|
|
15
|
-
CREATE INDEX IF NOT EXISTS idx_users_email ON users(email);
|
|
16
|
-
|
|
17
|
-
-- Create an index on deleted_at for soft delete queries
|
|
18
|
-
CREATE INDEX IF NOT EXISTS idx_users_deleted_at ON users(deleted_at);
|
|
19
|
-
|
|
20
|
-
-- Sample data
|
|
21
|
-
INSERT INTO users (first_name, last_name, email) VALUES
|
|
22
|
-
('Alice', 'Johnson', 'alice@example.com'),
|
|
23
|
-
('Bob', 'Smith', 'bob@example.com'),
|
|
24
|
-
('Charlie', 'Williams', 'charlie@example.com'),
|
|
25
|
-
('Diana', 'Brown', 'diana@example.com'),
|
|
26
|
-
('Eve', 'Davis', 'eve@example.com')
|
|
27
|
-
ON CONFLICT (email) DO NOTHING;
|