@framers/sql-storage-adapter 0.1.0 → 0.2.0
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/LICENSE +20 -20
- package/README.md +146 -363
- package/dist/adapters/baseStorageAdapter.d.ts +1 -1
- package/dist/adapters/baseStorageAdapter.d.ts.map +1 -1
- package/dist/adapters/betterSqliteAdapter.d.ts +27 -1
- package/dist/adapters/betterSqliteAdapter.d.ts.map +1 -1
- package/dist/adapters/betterSqliteAdapter.js +66 -13
- package/dist/adapters/betterSqliteAdapter.js.map +1 -1
- package/dist/adapters/capacitorSqliteAdapter.d.ts +1 -1
- package/dist/adapters/capacitorSqliteAdapter.d.ts.map +1 -1
- package/dist/adapters/capacitorSqliteAdapter.js +27 -4
- package/dist/adapters/capacitorSqliteAdapter.js.map +1 -1
- package/dist/adapters/postgresAdapter.d.ts +7 -1
- package/dist/adapters/postgresAdapter.d.ts.map +1 -1
- package/dist/adapters/postgresAdapter.js +19 -2
- package/dist/adapters/postgresAdapter.js.map +1 -1
- package/dist/adapters/sqlJsAdapter.d.ts +1 -1
- package/dist/adapters/sqlJsAdapter.d.ts.map +1 -1
- package/dist/adapters/sqlJsAdapter.js +16 -2
- package/dist/adapters/sqlJsAdapter.js.map +1 -1
- package/dist/adapters/supabase.d.ts +3 -3
- package/dist/adapters/supabase.d.ts.map +1 -1
- package/dist/adapters/supabase.js +11 -7
- package/dist/adapters/supabase.js.map +1 -1
- package/dist/{types → core/contracts}/context.d.ts +1 -1
- package/dist/core/contracts/context.d.ts.map +1 -0
- package/dist/core/contracts/context.js.map +1 -0
- package/dist/{types → core/contracts}/events.d.ts +1 -1
- package/dist/core/contracts/events.d.ts.map +1 -0
- package/dist/core/contracts/events.js.map +1 -0
- package/dist/{types → core/contracts}/extensions.d.ts +3 -3
- package/dist/core/contracts/extensions.d.ts.map +1 -0
- package/dist/core/contracts/extensions.js.map +1 -0
- package/dist/{types.d.ts → core/contracts/index.d.ts} +1 -1
- package/dist/core/contracts/index.d.ts.map +1 -0
- package/dist/{types.js → core/contracts/index.js} +1 -1
- package/dist/core/contracts/index.js.map +1 -0
- package/dist/core/contracts/limitations.d.ts.map +1 -0
- package/dist/core/contracts/limitations.js.map +1 -0
- package/dist/{database.d.ts → core/database.d.ts} +16 -3
- package/dist/core/database.d.ts.map +1 -0
- package/dist/{database.js → core/database.js} +39 -8
- package/dist/core/database.js.map +1 -0
- package/dist/{resolver.d.ts → core/resolver.d.ts} +4 -4
- package/dist/core/resolver.d.ts.map +1 -0
- package/dist/{resolver.js → core/resolver.js} +5 -5
- package/dist/core/resolver.js.map +1 -0
- package/dist/{utils → features/backup}/cloudBackup.d.ts +1 -1
- package/dist/features/backup/cloudBackup.d.ts.map +1 -0
- package/dist/{utils → features/backup}/cloudBackup.js +2 -2
- package/dist/features/backup/cloudBackup.js.map +1 -0
- package/dist/{utils → features/migrations}/dataExport.d.ts +1 -1
- package/dist/features/migrations/dataExport.d.ts.map +1 -0
- package/dist/features/migrations/dataExport.js.map +1 -0
- package/dist/{utils → features/migrations}/dataImport.d.ts +1 -1
- package/dist/features/migrations/dataImport.d.ts.map +1 -0
- package/dist/features/migrations/dataImport.js.map +1 -0
- package/dist/{utils → features/migrations}/migration.d.ts +2 -2
- package/dist/features/migrations/migration.d.ts.map +1 -0
- package/dist/{utils → features/migrations}/migration.js +6 -6
- package/dist/features/migrations/migration.js.map +1 -0
- package/dist/{utils → features/sync}/syncManager.d.ts +11 -5
- package/dist/features/sync/syncManager.d.ts.map +1 -0
- package/dist/{utils → features/sync}/syncManager.js +40 -10
- package/dist/features/sync/syncManager.js.map +1 -0
- package/dist/index.d.ts +10 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -19
- package/dist/index.js.map +1 -1
- package/dist/{utils → shared}/parameterUtils.d.ts +1 -1
- package/dist/shared/parameterUtils.d.ts.map +1 -0
- package/dist/shared/parameterUtils.js.map +1 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +11 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +11 -5
- package/dist/database.d.ts.map +0 -1
- package/dist/database.js.map +0 -1
- package/dist/resolver.d.ts.map +0 -1
- package/dist/resolver.js.map +0 -1
- package/dist/types/context.d.ts.map +0 -1
- package/dist/types/context.js.map +0 -1
- package/dist/types/events.d.ts.map +0 -1
- package/dist/types/events.js.map +0 -1
- package/dist/types/extensions.d.ts.map +0 -1
- package/dist/types/extensions.js.map +0 -1
- package/dist/types/limitations.d.ts.map +0 -1
- package/dist/types/limitations.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/utils/cloudBackup.d.ts.map +0 -1
- package/dist/utils/cloudBackup.js.map +0 -1
- package/dist/utils/dataExport.d.ts.map +0 -1
- package/dist/utils/dataExport.js.map +0 -1
- package/dist/utils/dataImport.d.ts.map +0 -1
- package/dist/utils/dataImport.js.map +0 -1
- package/dist/utils/migration.d.ts.map +0 -1
- package/dist/utils/migration.js.map +0 -1
- package/dist/utils/parameterUtils.d.ts.map +0 -1
- package/dist/utils/parameterUtils.js.map +0 -1
- package/dist/utils/syncManager.d.ts.map +0 -1
- package/dist/utils/syncManager.js.map +0 -1
- /package/dist/{types → core/contracts}/context.js +0 -0
- /package/dist/{types → core/contracts}/events.js +0 -0
- /package/dist/{types → core/contracts}/extensions.js +0 -0
- /package/dist/{types → core/contracts}/limitations.d.ts +0 -0
- /package/dist/{types → core/contracts}/limitations.js +0 -0
- /package/dist/{utils → features/migrations}/dataExport.js +0 -0
- /package/dist/{utils → features/migrations}/dataImport.js +0 -0
- /package/dist/{utils → shared}/parameterUtils.js +0 -0
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Framers
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Framers
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,363 +1,146 @@
|
|
|
1
|
-
# SQL Storage Adapter
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
##
|
|
44
|
-
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
await db.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
mode: 'auto', // Auto-sync after writes
|
|
148
|
-
conflictStrategy: 'last-write-wins'
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
// Work offline
|
|
153
|
-
await manager.db.run('INSERT INTO tasks (title) VALUES (?)', ['Buy milk']);
|
|
154
|
-
|
|
155
|
-
// Sync manually when needed
|
|
156
|
-
const result = await manager.sync();
|
|
157
|
-
console.log(`Synced ${result.recordsSynced} records`);
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
**Sync Modes:**
|
|
161
|
-
- `manual` - Call `sync()` explicitly (default)
|
|
162
|
-
- `auto` - Syncs after writes (debounced)
|
|
163
|
-
- `periodic` - Syncs every N seconds
|
|
164
|
-
- `realtime` - Syncs immediately on every write
|
|
165
|
-
- `on-reconnect` - Syncs when network returns
|
|
166
|
-
|
|
167
|
-
**Conflict Strategies:**
|
|
168
|
-
- `last-write-wins` - Newest timestamp wins (default)
|
|
169
|
-
- `local-wins` - Local always wins
|
|
170
|
-
- `remote-wins` - Server is authority
|
|
171
|
-
- `merge` - Custom merge function
|
|
172
|
-
- `keep-both` - Duplicate records
|
|
173
|
-
|
|
174
|
-
📖 **[Complete Offline Sync Guide](./guides/OFFLINE_SYNC.md)** - 8 real-world examples with mobile optimization
|
|
175
|
-
|
|
176
|
-
## Cloud Backups
|
|
177
|
-
|
|
178
|
-
Automatic S3-compatible backups (AWS S3, Cloudflare R2, MinIO):
|
|
179
|
-
|
|
180
|
-
```typescript
|
|
181
|
-
import { S3Client } from '@aws-sdk/client-s3';
|
|
182
|
-
import { createCloudBackupManager } from '@framers/sql-storage-adapter';
|
|
183
|
-
|
|
184
|
-
const s3 = new S3Client({
|
|
185
|
-
region: 'us-east-1',
|
|
186
|
-
credentials: {
|
|
187
|
-
accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
|
|
188
|
-
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
const manager = createCloudBackupManager(db, s3, 'my-backups', {
|
|
193
|
-
interval: 3600000, // Hourly backups
|
|
194
|
-
maxBackups: 24, // Keep 24 backups
|
|
195
|
-
options: { compression: 'gzip' }
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
manager.start(); // Auto-backup every hour
|
|
199
|
-
|
|
200
|
-
// Manual backup
|
|
201
|
-
await manager.backupNow();
|
|
202
|
-
|
|
203
|
-
// Restore
|
|
204
|
-
await manager.restore('backups/my-database-2024-01-15.json.gz');
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
## Data Migration
|
|
208
|
-
|
|
209
|
-
Export, import, and migrate between adapters:
|
|
210
|
-
|
|
211
|
-
```typescript
|
|
212
|
-
import {
|
|
213
|
-
migrateLocalToSupabase,
|
|
214
|
-
exportAsJSON,
|
|
215
|
-
importFromJSON
|
|
216
|
-
} from '@framers/sql-storage-adapter';
|
|
217
|
-
|
|
218
|
-
// Export to JSON
|
|
219
|
-
const backup = await exportAsJSON(db, {
|
|
220
|
-
tables: ['users', 'posts'],
|
|
221
|
-
includeSchema: true
|
|
222
|
-
});
|
|
223
|
-
|
|
224
|
-
// Import from JSON
|
|
225
|
-
await importFromJSON(db, backup, {
|
|
226
|
-
dropTables: true,
|
|
227
|
-
batchSize: 100
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
// Migrate SQLite → PostgreSQL
|
|
231
|
-
const result = await migrateLocalToSupabase(sqliteDb, postgresDb, {
|
|
232
|
-
verify: true,
|
|
233
|
-
onConflict: 'replace'
|
|
234
|
-
});
|
|
235
|
-
|
|
236
|
-
console.log(`Migrated ${result.rowsImported} rows in ${result.duration}ms`);
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
## PostgreSQL Remote Connections
|
|
240
|
-
|
|
241
|
-
Connect to hosted databases (AWS RDS, Heroku, Supabase, etc.):
|
|
242
|
-
|
|
243
|
-
```typescript
|
|
244
|
-
import { connectDatabase } from '@framers/sql-storage-adapter';
|
|
245
|
-
|
|
246
|
-
// Auto-detect from DATABASE_URL
|
|
247
|
-
const db = await connectDatabase(process.env.DATABASE_URL);
|
|
248
|
-
|
|
249
|
-
// Or configure explicitly
|
|
250
|
-
const db = await connectDatabase({
|
|
251
|
-
host: 'db.example.com',
|
|
252
|
-
database: 'myapp',
|
|
253
|
-
user: 'dbuser',
|
|
254
|
-
password: process.env.DB_PASSWORD,
|
|
255
|
-
ssl: true,
|
|
256
|
-
max: 20 // Connection pool size
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
// Same API as SQLite!
|
|
260
|
-
const users = await db.all('SELECT * FROM users');
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
📖 **[PostgreSQL Remote Guide](./guides/POSTGRES_REMOTE_CONNECTION.md)** - Cloud provider examples & SSL config
|
|
264
|
-
|
|
265
|
-
## Adapter Comparison
|
|
266
|
-
|
|
267
|
-
| Adapter | Best For | Speed | Size | Concurrent |
|
|
268
|
-
|---------|----------|-------|------|------------|
|
|
269
|
-
| **PostgreSQL** | Production servers | ⚡⚡⚡ | N/A | ✅ Yes |
|
|
270
|
-
| **better-sqlite3** | Desktop apps | ⚡⚡⚡ | 6 MB | ❌ No |
|
|
271
|
-
| **SQL.js** | Browsers | ⚡ | 2.3 MB | ❌ No |
|
|
272
|
-
| **Capacitor** | Mobile apps | ⚡⚡⚡ | ~1 MB | ❌ No |
|
|
273
|
-
|
|
274
|
-
## TypeScript Support
|
|
275
|
-
|
|
276
|
-
Full type safety with generics:
|
|
277
|
-
|
|
278
|
-
```typescript
|
|
279
|
-
interface User {
|
|
280
|
-
id: number;
|
|
281
|
-
name: string;
|
|
282
|
-
email: string;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
// Type-safe queries
|
|
286
|
-
const user = await db.get<User>('SELECT * FROM users WHERE id = ?', [1]);
|
|
287
|
-
// user: User | null
|
|
288
|
-
|
|
289
|
-
const users = await db.all<User>('SELECT * FROM users');
|
|
290
|
-
// users: User[]
|
|
291
|
-
|
|
292
|
-
// Runtime introspection
|
|
293
|
-
const context = db.context;
|
|
294
|
-
console.log('Adapter:', db.kind);
|
|
295
|
-
console.log('Capabilities:', Array.from(db.capabilities));
|
|
296
|
-
console.log('Max connections:', context.getLimitations().maxConnections);
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
## Event Monitoring
|
|
300
|
-
|
|
301
|
-
Track queries and performance:
|
|
302
|
-
|
|
303
|
-
```typescript
|
|
304
|
-
db.events.on('query:error', (event) => {
|
|
305
|
-
console.error('Query failed:', event.statement, event.error);
|
|
306
|
-
});
|
|
307
|
-
|
|
308
|
-
db.events.on('performance:slow-query', (event) => {
|
|
309
|
-
if (event.duration > 1000) {
|
|
310
|
-
console.warn(`Slow query (${event.duration}ms):`, event.statement);
|
|
311
|
-
}
|
|
312
|
-
});
|
|
313
|
-
|
|
314
|
-
db.events.on('transaction:rollback', (event) => {
|
|
315
|
-
console.warn('Transaction rolled back:', event.error);
|
|
316
|
-
});
|
|
317
|
-
```
|
|
318
|
-
|
|
319
|
-
## Examples
|
|
320
|
-
|
|
321
|
-
Real-world usage in `examples/`:
|
|
322
|
-
- `basic-usage.ts` - Getting started
|
|
323
|
-
- `remote-postgres.ts` - Cloud database connections
|
|
324
|
-
- `electron-app/` - Desktop app with better-sqlite3
|
|
325
|
-
- `browser-extension/` - Chrome extension with SQL.js
|
|
326
|
-
- `full-stack/` - Shared code frontend/backend
|
|
327
|
-
- `offline-sync.ts` - Auto-sync patterns
|
|
328
|
-
- `testing/` - Unit testing strategies
|
|
329
|
-
|
|
330
|
-
## FAQ
|
|
331
|
-
|
|
332
|
-
**Q: Which adapter should I use?**
|
|
333
|
-
Use `createDatabase()` - it auto-picks the best adapter for your environment.
|
|
334
|
-
|
|
335
|
-
**Q: Can I switch adapters later?**
|
|
336
|
-
Yes. Use migration functions to move data between adapters.
|
|
337
|
-
|
|
338
|
-
**Q: Is this production-ready?**
|
|
339
|
-
Yes. Built on battle-tested libraries (pg, better-sqlite3, sql.js). The adapter layer adds <1% overhead.
|
|
340
|
-
|
|
341
|
-
**Q: What about schema migrations?**
|
|
342
|
-
Use any migration tool: [`node-pg-migrate`](https://github.com/salsita/node-pg-migrate), [`prisma`](https://www.prisma.io/), or raw SQL.
|
|
343
|
-
|
|
344
|
-
**Q: How do I handle conflicts in sync?**
|
|
345
|
-
Use `conflictStrategy`: `last-write-wins` (default), `local-wins`, `remote-wins`, `merge`, or `keep-both`.
|
|
346
|
-
|
|
347
|
-
**Q: Can I sync only on WiFi?**
|
|
348
|
-
Yes. Use `mode: 'manual'` and call `sync()` when `isOnWiFi === true`. See [Offline Sync Guide](./guides/OFFLINE_SYNC.md#1-mobile-app-with-wifi-only-sync).
|
|
349
|
-
|
|
350
|
-
## Documentation
|
|
351
|
-
|
|
352
|
-
- **[API Documentation](https://wearetheframers.github.io/sql-storage-adapter/)** - Complete TypeDoc reference
|
|
353
|
-
- **[Offline Sync Guide](./guides/OFFLINE_SYNC.md)** - Comprehensive sync patterns
|
|
354
|
-
- **[PostgreSQL Guide](./guides/POSTGRES_REMOTE_CONNECTION.md)** - Remote database setup
|
|
355
|
-
- **[Architecture](./ARCHITECTURE.md)** - Design decisions
|
|
356
|
-
|
|
357
|
-
## Contributing
|
|
358
|
-
|
|
359
|
-
See [CONTRIBUTING.md](./CONTRIBUTING.md)
|
|
360
|
-
|
|
361
|
-
## License
|
|
362
|
-
|
|
363
|
-
MIT © [The Framers](https://frame.dev)
|
|
1
|
+
# SQL Storage Adapter
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://frame.dev" target="_blank" rel="noopener">
|
|
5
|
+
<picture>
|
|
6
|
+
<source media="(prefers-color-scheme: dark)" srcset="./logos/frame-square-blue-dark-no-tagline.svg">
|
|
7
|
+
<source media="(prefers-color-scheme: light)" srcset="./logos/frame-square-blue-no-tagline.svg">
|
|
8
|
+
<img src="./logos/frame-square-blue-no-tagline.svg" alt="Frame.dev" width="200">
|
|
9
|
+
</picture>
|
|
10
|
+
</a>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
[](https://www.npmjs.com/package/@framers/sql-storage-adapter)
|
|
14
|
+
[](https://github.com/framersai/sql-storage-adapter/actions/workflows/ci.yml)
|
|
15
|
+
[](https://codecov.io/gh/framersai/sql-storage-adapter)
|
|
16
|
+
[](https://www.typescriptlang.org/)
|
|
17
|
+
[](./LICENSE)
|
|
18
|
+
|
|
19
|
+
> Cross-platform SQL access for Node.js, web, and native runtimes with automatic adapter selection and consistent APIs.
|
|
20
|
+
|
|
21
|
+
The SQL Storage Adapter provides a single, ergonomic interface over SQLite (native and WASM), PostgreSQL, Capacitor, and in-memory stores. It handles adapter discovery, capability detection, and advanced features like cloud backups so you can focus on your application logic.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
- [Features](#features)
|
|
26
|
+
- [Installation](#installation)
|
|
27
|
+
- [Quick Start](#quick-start)
|
|
28
|
+
- [Adapter Matrix](#adapter-matrix)
|
|
29
|
+
- [Configuration & Resolution](#configuration--resolution)
|
|
30
|
+
- [CI, Releases, and Badges](#ci-releases-and-badges)
|
|
31
|
+
- [Troubleshooting](#troubleshooting)
|
|
32
|
+
- [Contributing](#contributing)
|
|
33
|
+
- [License](#license)
|
|
34
|
+
|
|
35
|
+
## Features
|
|
36
|
+
|
|
37
|
+
- **Auto-detected adapters** – `createDatabase()` inspects environment signals and picks the best backend (native SQLite, PostgreSQL, Capacitor, sql.js, memory, etc.).
|
|
38
|
+
- **Capability-aware API** – consistent CRUD, transactions, batching, and event hooks across adapters with runtime capability introspection.
|
|
39
|
+
- **Cloud backups & migrations** – built-in backup manager with compression, retention policies, and restore helpers plus migration utilities.
|
|
40
|
+
- **Portable packaging** – optional native dependencies; falls back to pure TypeScript/WASM adapters when native modules are unavailable.
|
|
41
|
+
- **CI-first design** – Vitest coverage, Codecov integration, and GitHub Actions workflows for linting, testing, releasing, and npm publish/tag automation.
|
|
42
|
+
|
|
43
|
+
## Installation
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Core package
|
|
47
|
+
npm install @framers/sql-storage-adapter
|
|
48
|
+
|
|
49
|
+
# Install only the adapters you plan to use
|
|
50
|
+
npm install better-sqlite3 # Native SQLite for Node/Electron
|
|
51
|
+
npm install pg # PostgreSQL
|
|
52
|
+
npm install @capacitor-community/sqlite # Capacitor / mobile
|
|
53
|
+
# sql.js ships with the package (no extra install)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
> Windows users: ensure the Visual Studio Build Tools (C++ workload) are installed before adding `better-sqlite3`. On Linux, install `python3`, `build-essential`, and `libssl-dev` prior to `npm install`.
|
|
57
|
+
|
|
58
|
+
## Quick Start
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
import { createDatabase } from '@framers/sql-storage-adapter';
|
|
62
|
+
|
|
63
|
+
async function main() {
|
|
64
|
+
// Automatically selects the best adapter for the current runtime
|
|
65
|
+
const db = await createDatabase();
|
|
66
|
+
|
|
67
|
+
await db.exec(`
|
|
68
|
+
CREATE TABLE IF NOT EXISTS todos (
|
|
69
|
+
id INTEGER PRIMARY KEY,
|
|
70
|
+
task TEXT NOT NULL,
|
|
71
|
+
done INTEGER DEFAULT 0
|
|
72
|
+
)
|
|
73
|
+
`);
|
|
74
|
+
|
|
75
|
+
await db.run('INSERT INTO todos (task) VALUES (?)', ['Ship cross-platform builds']);
|
|
76
|
+
const items = await db.all<{ id: number; task: string; done: number }>('SELECT * FROM todos');
|
|
77
|
+
console.log(items);
|
|
78
|
+
|
|
79
|
+
await db.close();
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
main().catch((error) => {
|
|
83
|
+
console.error('Database bootstrap failed', error);
|
|
84
|
+
process.exit(1);
|
|
85
|
+
});
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Adapter Matrix
|
|
89
|
+
|
|
90
|
+
| Adapter | Package | Ideal for | Pros | Considerations |
|
|
91
|
+
| --- | --- | --- | --- | --- |
|
|
92
|
+
| `better-sqlite3` | `better-sqlite3` | Node/Electron, CLI, CI | Native performance, transactional semantics, WAL support | Needs native toolchain; version must match Node ABI |
|
|
93
|
+
| `postgres` | `pg` | Hosted or on-prem PostgreSQL | Connection pooling, rich SQL features, cloud friendly | Requires `DATABASE_URL`/credentials |
|
|
94
|
+
| `sqljs` | bundled | Browsers, serverless edge, native fallback | Pure WASM, no native deps | Write performance limited vs native, optional persistence |
|
|
95
|
+
| `capacitor` | `@capacitor-community/sqlite` | Mobile (iOS/Android, Capacitor) | Native SQLite on mobile | Requires Capacitor runtime |
|
|
96
|
+
| `memory` | built-in | Unit tests, storybooks, constrained sandboxes | Zero dependencies, instant startup | Non-durable, single-process only |
|
|
97
|
+
|
|
98
|
+
## Configuration & Resolution
|
|
99
|
+
|
|
100
|
+
- `resolveStorageAdapter` inspects:
|
|
101
|
+
- explicit options (`priority`, `type`, adapter configs),
|
|
102
|
+
- environment variables (`STORAGE_ADAPTER`, `DATABASE_URL`),
|
|
103
|
+
- runtime hints (Capacitor detection, browser globals).
|
|
104
|
+
- Adapters are attempted in priority order until one opens successfully; a `StorageResolutionError` includes the full failure chain.
|
|
105
|
+
- Provide `priority: ['memory', 'sqljs']` for browser bundles or tests where native modules shouldn’t load.
|
|
106
|
+
- Use `createCloudBackupManager` for S3-compatible backups with gzip compression and retention limits.
|
|
107
|
+
|
|
108
|
+
## CI, Releases, and Badges
|
|
109
|
+
|
|
110
|
+
- GitHub Actions workflows:
|
|
111
|
+
- `ci.yml` runs lint, tests, and coverage on every branch.
|
|
112
|
+
- `release.yml` publishes new versions to npm, tags the commit (`vX.Y.Z`), and creates/updates the GitHub Release when `CHANGELOG.md` and `package.json` bump the version.
|
|
113
|
+
- Check badge health whenever builds fail:
|
|
114
|
+
- CI badge should be green for `master`.
|
|
115
|
+
- Codecov badge updates after coverage reports upload.
|
|
116
|
+
- npm badge reflects the latest published version.
|
|
117
|
+
- Manual verification commands:
|
|
118
|
+
```bash
|
|
119
|
+
npm info @framers/sql-storage-adapter version
|
|
120
|
+
pnpm --filter sql-storage-adapter test
|
|
121
|
+
pnpm --filter sql-storage-adapter build
|
|
122
|
+
```
|
|
123
|
+
- See [RELEASING.md](./RELEASING.md) for the automated release flow, required secrets (`NPM_TOKEN`), and manual fallback steps.
|
|
124
|
+
|
|
125
|
+
## Troubleshooting
|
|
126
|
+
|
|
127
|
+
- **`better-sqlite3` cannot be required** – install native build tools before `npm install`, ensure Node version matches prebuilt binaries, or fall back to sql.js by setting `STORAGE_ADAPTER=sqljs`.
|
|
128
|
+
- **Adapter resolution picks the wrong backend** – set `priority` or `STORAGE_ADAPTER` explicitly; register new adapters in `src/core/resolver.ts`.
|
|
129
|
+
- **Cloud backup tests lock the database** – call `await db.close()` in test teardown; use the in-memory/sql.js fallback on runners without native SQLite.
|
|
130
|
+
- **GitHub release missing** – confirm `release.yml` succeeded, `NPM_TOKEN` is configured, and the version bump is committed. Rerun the workflow if needed.
|
|
131
|
+
- **Missing lock file in subtree mirror** – keep `pnpm-lock.yaml` committed so CI caches dependencies correctly when this package is mirrored out of a monorepo.
|
|
132
|
+
|
|
133
|
+
## Contributing
|
|
134
|
+
|
|
135
|
+
- Read [CONTRIBUTING.md](./CONTRIBUTING.md) for coding standards, lint/test commands, and pull request guidelines.
|
|
136
|
+
- Architecture notes live in [ARCHITECTURE.md](./ARCHITECTURE.md); API docs can be regenerated with `pnpm --filter sql-storage-adapter run docs`.
|
|
137
|
+
|
|
138
|
+
## License
|
|
139
|
+
|
|
140
|
+
[MIT](./LICENSE)
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
<p align="center">
|
|
145
|
+
Built and maintained by <a href="https://frame.dev" target="_blank" rel="noopener">Frame.dev</a>
|
|
146
|
+
</p>
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* }
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
30
|
-
import type { StorageAdapter, StorageCapability, StorageOpenOptions, StorageParameters, StorageRunResult, BatchOperation, BatchResult, PreparedStatement } from '../
|
|
30
|
+
import type { StorageAdapter, StorageCapability, StorageOpenOptions, StorageParameters, StorageRunResult, BatchOperation, BatchResult, PreparedStatement } from '../core/contracts';
|
|
31
31
|
/**
|
|
32
32
|
* Options for BaseStorageAdapter configuration.
|
|
33
33
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseStorageAdapter.d.ts","sourceRoot":"","sources":["../../src/adapters/baseStorageAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,iBAAiB,EAClB,MAAM,
|
|
1
|
+
{"version":3,"file":"baseStorageAdapter.d.ts","sourceRoot":"","sources":["../../src/adapters/baseStorageAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAa3B;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,+CAA+C;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,+DAA+D;IAC/D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gDAAgD;IAChD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,uCAAuC;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,uDAAuD;IACvD,cAAc,EAAE,MAAM,CAAC;IACvB,mCAAmC;IACnC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,6BAA6B;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,6CAA6C;IAC7C,oBAAoB,EAAE,MAAM,CAAC;IAC7B,mCAAmC;IACnC,QAAQ,EAAE,IAAI,GAAG,IAAI,CAAC;CACvB;AAED;;;;;;;;;GASG;AACH,8BAAsB,kBAAmB,YAAW,cAAc;IAEhE,kBAAyB,IAAI,EAAE,MAAM,CAAC;IACtC,kBAAyB,YAAY,EAAE,WAAW,CAAC,iBAAiB,CAAC,CAAC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,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAepD;;OAEG;IACH,SAAS,CAAC,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK;IAY3D;;OAEG;IACH,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAMpC;;OAEG;IACH,OAAO,CAAC,aAAa;IAqBrB;;OAEG;IACI,QAAQ,IAAI,MAAM;IAIzB;;OAEG;IACI,UAAU,IAAI,QAAQ,CAAC,cAAc,CAAC;IAI7C;;OAEG;IACI,MAAM,IAAI,OAAO;IAIxB;;OAEG;IACI,QAAQ,IAAI,OAAO;IAI1B;;OAEG;IACI,SAAS,IAAI,MAAM;CAM3B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { StorageAdapter, StorageOpenOptions, StorageParameters, StorageRunResult, StorageCapability, BatchOperation, BatchResult } from '../
|
|
1
|
+
import type { StorageAdapter, StorageOpenOptions, StorageParameters, StorageRunResult, StorageCapability, BatchOperation, BatchResult } from '../core/contracts';
|
|
2
2
|
/**
|
|
3
3
|
* Native SQLite adapter using better-sqlite3.
|
|
4
4
|
*
|
|
@@ -23,6 +23,18 @@ import type { StorageAdapter, StorageOpenOptions, StorageParameters, StorageRunR
|
|
|
23
23
|
* - Automatically enables WAL mode for better concurrency
|
|
24
24
|
* - Handles database corruption with automatic recovery
|
|
25
25
|
*/
|
|
26
|
+
/**
|
|
27
|
+
* Native SQLite adapter backed by the `better-sqlite3` module.
|
|
28
|
+
*
|
|
29
|
+
* Features:
|
|
30
|
+
* - Synchronous & high-performance local storage
|
|
31
|
+
* - WAL support, prepared statements, batched writes
|
|
32
|
+
* - Graceful degradation when the native module is absent
|
|
33
|
+
*
|
|
34
|
+
* Browser Safety:
|
|
35
|
+
* This class can be imported in browser bundles without immediate failure.
|
|
36
|
+
* A runtime error is only thrown if `open()` is invoked in a browser context.
|
|
37
|
+
*/
|
|
26
38
|
export declare class BetterSqliteAdapter implements StorageAdapter {
|
|
27
39
|
private readonly defaultFilePath;
|
|
28
40
|
readonly kind = "better-sqlite3";
|
|
@@ -37,6 +49,11 @@ export declare class BetterSqliteAdapter implements StorageAdapter {
|
|
|
37
49
|
* Will be created if it doesn't exist.
|
|
38
50
|
*/
|
|
39
51
|
constructor(defaultFilePath: string);
|
|
52
|
+
/**
|
|
53
|
+
* Open (or no-op if already open) the underlying native database.
|
|
54
|
+
*
|
|
55
|
+
* Throws a descriptive error if called in a browser environment.
|
|
56
|
+
*/
|
|
40
57
|
open(options?: StorageOpenOptions): Promise<void>;
|
|
41
58
|
run(statement: string, parameters?: StorageParameters): Promise<StorageRunResult>;
|
|
42
59
|
get<T = unknown>(statement: string, parameters?: StorageParameters): Promise<T | null>;
|
|
@@ -60,5 +77,14 @@ export declare class BetterSqliteAdapter implements StorageAdapter {
|
|
|
60
77
|
/**
|
|
61
78
|
* Factory helper.
|
|
62
79
|
*/
|
|
80
|
+
/**
|
|
81
|
+
* Factory helper for creating a BetterSqliteAdapter.
|
|
82
|
+
*
|
|
83
|
+
* Path Resolution:
|
|
84
|
+
* - Absolute paths are used as-is.
|
|
85
|
+
* - Relative paths are resolved against the current working directory instead
|
|
86
|
+
* of the adapter file location (simpler & bundler neutral).
|
|
87
|
+
* - Special values like ':memory:' and 'file:' URIs are passed through.
|
|
88
|
+
*/
|
|
63
89
|
export declare const createBetterSqliteAdapter: (filePath: string) => StorageAdapter;
|
|
64
90
|
//# sourceMappingURL=betterSqliteAdapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"betterSqliteAdapter.d.ts","sourceRoot":"","sources":["../../src/adapters/betterSqliteAdapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"betterSqliteAdapter.d.ts","sourceRoot":"","sources":["../../src/adapters/betterSqliteAdapter.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,g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