Skip to content

Commit 5e8e5c9

Browse files
committed
Rename memdb VFS option to memory and bump version
1 parent 01bcba0 commit 5e8e5c9

6 files changed

Lines changed: 10 additions & 10 deletions

File tree

PROJECT_SUMMARY.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ All aspects are configurable with sensible defaults:
5555
interface SQLiteWASMConfig {
5656
filename: string;
5757
vfs?: {
58-
type?: 'opfs-sahpool' | 'opfs' | 'memdb';
58+
type?: 'opfs-sahpool' | 'opfs' | 'memory';
5959
poolConfig?: {
6060
initialCapacity?: number; // Default: 3
6161
clearOnInit?: boolean; // Default: false
@@ -184,13 +184,13 @@ await db.transaction(async (tx) => {
184184
| **Configuration** | Hardcoded values | Fully configurable |
185185
| **Table API** | Full ORM-like (insert, update, delete, etc.) | Type hints only (query, exec, run) |
186186
| **PRAGMA** | Hardcoded (MEMORY, NORMAL) | User configurable |
187-
| **VFS** | Hardcoded opfs-sahpool | User can choose (opfs-sahpool, opfs, memdb) |
187+
| **VFS** | Hardcoded opfs-sahpool | User can choose (opfs-sahpool, opfs, memory) |
188188
| **Pool Config** | Fixed (initialCapacity: 3) | Configurable |
189189
| **Console Filtering** | Always on | Optional (configurable) |
190190

191191
## What's Configurable (vs Hardcoded Before)
192192

193-
**VFS Method** - User chooses: opfs-sahpool, opfs, or memdb
193+
**VFS Method** - User chooses: opfs-sahpool, opfs, or memory
194194
**Pool Settings** - initialCapacity, clearOnInit, name
195195
**PRAGMA Settings** - journal_mode, synchronous, temp_store, cache_size, etc.
196196
**Logging** - filterSqlTrace, custom print/printErr functions

QUICKSTART.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ const users = await usersTable.query('SELECT * FROM users');
8989
const db = new SQLiteWASM({
9090
filename: 'myapp.db',
9191
vfs: {
92-
type: 'opfs-sahpool', // or 'opfs', 'memdb'
92+
type: 'opfs-sahpool', // or 'opfs', 'memory'
9393
poolConfig: {
9494
initialCapacity: 5,
9595
name: 'my-custom-pool'
@@ -155,7 +155,7 @@ await db.delete() // Delete database
155155
vfs?: {
156156
type?: 'opfs-sahpool' // Default: 'opfs-sahpool'
157157
| 'opfs'
158-
| 'memdb';
158+
| 'memory';
159159
poolConfig?: {
160160
initialCapacity?: number; // Default: 3
161161
clearOnInit?: boolean; // Default: false

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Key interfaces for better TypeScript integration.
122122
interface SQLiteWASMConfig {
123123
filename: string; // Required: Database file name
124124
vfs?: {
125-
type?: 'opfs' | 'opfs-sahpool' | 'memdb'; // Default: 'opfs'
125+
type?: 'opfs' | 'opfs-sahpool' | 'memory'; // Default: 'opfs'
126126
poolConfig?: {
127127
// Only used when type is 'opfs-sahpool'
128128
initialCapacity?: number; // Default: 3

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@haroonwaves/sqlite-wasm-easy",
3-
"version": "0.2.5",
3+
"version": "0.2.6",
44
"description": "A simple, zero-config wrapper around @sqlite.org/sqlite-wasm",
55
"type": "module",
66
"main": "./dist/index.js",

src/types/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* VFS (Virtual File System) type options
33
*/
4-
export type VFSType = 'opfs-sahpool' | 'opfs' | 'memdb';
4+
export type VFSType = 'opfs-sahpool' | 'opfs' | 'memory';
55

66
/**
77
* PRAGMA journal_mode options

src/worker/sqliteWorker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ async function initDatabase(config: SQLiteWASMConfig) {
5252
} else if (vfsType === 'opfs') {
5353
// Direct OPFS VFS (if available)
5454
PoolUtil = sqlite3.opfs || null;
55-
} else if (vfsType === 'memdb') {
55+
} else if (vfsType === 'memory') {
5656
// In-memory database
5757
PoolUtil = null;
5858
}
@@ -69,7 +69,7 @@ async function openDatabase(filename: string) {
6969
flags: 'create',
7070
vfs: 'opfs-sahpool',
7171
});
72-
} else if (vfsType === 'memdb') {
72+
} else if (vfsType === 'memory') {
7373
db = new sqlite3.oo1.DB(':memory:', 'c');
7474
} else {
7575
// Check if OpfsDb is available (requires COOP/COEP headers)

0 commit comments

Comments
 (0)