diff --git a/PROJECT_SUMMARY.md b/PROJECT_SUMMARY.md index f5aade9..37b4d7c 100644 --- a/PROJECT_SUMMARY.md +++ b/PROJECT_SUMMARY.md @@ -55,7 +55,7 @@ All aspects are configurable with sensible defaults: interface SQLiteWASMConfig { filename: string; vfs?: { - type?: 'opfs-sahpool' | 'opfs' | 'memdb'; + type?: 'opfs-sahpool' | 'opfs' | 'memory'; poolConfig?: { initialCapacity?: number; // Default: 3 clearOnInit?: boolean; // Default: false @@ -184,13 +184,13 @@ await db.transaction(async (tx) => { | **Configuration** | Hardcoded values | Fully configurable | | **Table API** | Full ORM-like (insert, update, delete, etc.) | Type hints only (query, exec, run) | | **PRAGMA** | Hardcoded (MEMORY, NORMAL) | User configurable | -| **VFS** | Hardcoded opfs-sahpool | User can choose (opfs-sahpool, opfs, memdb) | +| **VFS** | Hardcoded opfs-sahpool | User can choose (opfs-sahpool, opfs, memory) | | **Pool Config** | Fixed (initialCapacity: 3) | Configurable | | **Console Filtering** | Always on | Optional (configurable) | ## What's Configurable (vs Hardcoded Before) -✅ **VFS Method** - User chooses: opfs-sahpool, opfs, or memdb +✅ **VFS Method** - User chooses: opfs-sahpool, opfs, or memory ✅ **Pool Settings** - initialCapacity, clearOnInit, name ✅ **PRAGMA Settings** - journal_mode, synchronous, temp_store, cache_size, etc. ✅ **Logging** - filterSqlTrace, custom print/printErr functions diff --git a/QUICKSTART.md b/QUICKSTART.md index 6ab9e7e..4cf8857 100644 --- a/QUICKSTART.md +++ b/QUICKSTART.md @@ -89,7 +89,7 @@ const users = await usersTable.query('SELECT * FROM users'); const db = new SQLiteWASM({ filename: 'myapp.db', vfs: { - type: 'opfs-sahpool', // or 'opfs', 'memdb' + type: 'opfs-sahpool', // or 'opfs', 'memory' poolConfig: { initialCapacity: 5, name: 'my-custom-pool' @@ -155,7 +155,7 @@ await db.delete() // Delete database vfs?: { type?: 'opfs-sahpool' // Default: 'opfs-sahpool' | 'opfs' - | 'memdb'; + | 'memory'; poolConfig?: { initialCapacity?: number; // Default: 3 clearOnInit?: boolean; // Default: false diff --git a/README.md b/README.md index 00be694..eedb7e9 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ Key interfaces for better TypeScript integration. interface SQLiteWASMConfig { filename: string; // Required: Database file name vfs?: { - type?: 'opfs' | 'opfs-sahpool' | 'memdb'; // Default: 'opfs' + type?: 'opfs' | 'opfs-sahpool' | 'memory'; // Default: 'opfs' poolConfig?: { // Only used when type is 'opfs-sahpool' initialCapacity?: number; // Default: 3 diff --git a/package.json b/package.json index f104a18..1a22608 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@haroonwaves/sqlite-wasm-easy", - "version": "0.2.5", + "version": "0.2.6", "description": "A simple, zero-config wrapper around @sqlite.org/sqlite-wasm", "type": "module", "main": "./dist/index.js", diff --git a/src/types/index.ts b/src/types/index.ts index c74a538..6ba0bc0 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,7 +1,7 @@ /** * VFS (Virtual File System) type options */ -export type VFSType = 'opfs-sahpool' | 'opfs' | 'memdb'; +export type VFSType = 'opfs-sahpool' | 'opfs' | 'memory'; /** * PRAGMA journal_mode options diff --git a/src/worker/sqliteWorker.ts b/src/worker/sqliteWorker.ts index 5b10038..cee49a1 100644 --- a/src/worker/sqliteWorker.ts +++ b/src/worker/sqliteWorker.ts @@ -52,7 +52,7 @@ async function initDatabase(config: SQLiteWASMConfig) { } else if (vfsType === 'opfs') { // Direct OPFS VFS (if available) PoolUtil = sqlite3.opfs || null; - } else if (vfsType === 'memdb') { + } else if (vfsType === 'memory') { // In-memory database PoolUtil = null; } @@ -69,7 +69,7 @@ async function openDatabase(filename: string) { flags: 'create', vfs: 'opfs-sahpool', }); - } else if (vfsType === 'memdb') { + } else if (vfsType === 'memory') { db = new sqlite3.oo1.DB(':memory:', 'c'); } else { // Check if OpfsDb is available (requires COOP/COEP headers)