jsql-neo 4.4.0 → 4.4.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.
Files changed (2) hide show
  1. package/README.md +210 -150
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,229 +1,289 @@
1
- # JSQL-NEO v4.0.1
1
+ # JSQL-NEO
2
2
 
3
- Rust-powered embedded database with **three engines + SQL + Redis-style storage** in one npm package.
3
+ > **One engine to rule them all** a Rust-powered embedded database that speaks your language:
4
+ > MySQL protocol. Redis protocol. SQL. TypeScript. The browser. **And it fits in one npm package.**
4
5
 
5
- ## Engines
6
+ ![Engines](https://img.shields.io/badge/engines-Native%20%7C%20WASM%20%7C%20Pure%20JS-7ee787)
7
+ ![MySQL](https://img.shields.io/badge/protocol-MySQL%20compatible-1f6feb)
8
+ ![Redis](https://img.shields.io/badge/protocol-Redis%20RESP2-f03c15)
9
+ ![ZERO](https://img.shields.io/badge/dependencies-ZERO-8957e5)
10
+ ![WASM](https://img.shields.io/badge/runs%20in-Browser%20%28WASM%29-79c0ff)
11
+
12
+ ---
13
+
14
+ ## Why JSQL-NEO?
6
15
 
7
- | Engine | Entry | Use Case |
8
- |--------|-------|----------|
9
- | **Native** (Rust N-API, fastest) | `NativeJSQL` | Node.js, best performance |
10
- | **WASM** (Rust → wasm-pack, zero native deps) | `JSQL` | Node.js / browsers, no native addon |
11
- | **Pure JS** (local JSON file, SQLite-like) | `Database` | Local file persistence, legacy API |
16
+ Most embedded databases make you choose: *native speed*, *portable WASM*, or *a familiar file format*.
17
+ JSQL-NEO gives you **all three in one install** — plus drop-in compatibility with the **two most popular
18
+ database protocols in the world**.
12
19
 
13
- All engines share the same API (`createTable` / `insert` / `findById` / `find` / `updateById` / `removeById` / `dropTable`) plus `executeSQL()`.
20
+ - **Rust core** N-API native addon, ~2× faster than better-sqlite3 (see [Benchmark](#benchmark))
21
+ - 🧩 **WASM build** — the *same engine* runs in Node.js **and any browser**, zero native deps
22
+ - 🐘 **MySQL protocol** — Sequelize, Knex, TypeORM, mysql2, phpMyAdmin … **just work**, no plugin
23
+ - 🐇 **Redis protocol** — ioredis, node-redis, redis-cli — strings, hashes, lists, sets, TTL, snapshots
24
+ - 🌐 **Built-in Web UI** — a zero-dependency management console ships with the package
25
+ - 🗃️ **Three storage modes** — memory-first, hybrid (LRU + async flush), and disk
26
+ - 📦 **Zero runtime dependencies** — the whole world is your `node_modules`
27
+ - 🏷️ **Typed** — full TypeScript declarations for every API surface
28
+
29
+ ```
30
+ ┌─────────────────────────── JSQL-NEO ───────────────────────────┐
31
+ │ │
32
+ Node.js ──┤ Native (Rust N-API) Fastest path, zero deps │
33
+ Node.js ──┤ WASM (Rust → wasm) Portable, no native addon │
34
+ Browser ──┤ WASM (+ IndexedDB) Full SQL engine in your browser │
35
+ Anywhere ─┤ Pure JS (JSON file) SQLite-like local persistence │
36
+ │ │
37
+ ├── speak MySQL ──────────► Sequelize / Knex / TypeORM / mysql2 │
38
+ ├── speak Redis ──────────► ioredis / node-redis / redis-cli │
39
+ ├── speak HTTP ───────────► built-in Web UI + management APIs │
40
+ └── speak SQL ────────────► CREATE / SELECT / JOIN / aggregates │
41
+
42
+ ```
14
43
 
15
- ## SQL
44
+ ## 30-second Quick Start
45
+
46
+ ```bash
47
+ npm install jsql-neo
48
+ ```
16
49
 
17
50
  ```js
18
51
  const jsql = require('jsql-neo');
19
- const db = new jsql.NativeJSQL();
52
+ const db = new jsql.NativeJSQL(); // fastest engine
20
53
  await db.start();
21
54
 
22
55
  await jsql.executeSQL(db, 'CREATE TABLE users (id INTEGER PRIMARY KEY AUTO_INCREMENT, name STRING, age INTEGER)');
23
- await jsql.executeSQL(db, "INSERT INTO users (name, age) VALUES ('Alice', 30), ('Bob', 25)");
24
- await jsql.executeSQL(db, "INSERT INTO users VALUES (5, 'Carol', 35) ON DUPLICATE KEY UPDATE age = 30");
56
+ await jsql.executeSQL(db, "INSERT INTO users (name, age) VALUES ('Alice', 30), ('Bob', 25), ('Carol', 35)");
25
57
  const r = await jsql.executeSQL(db, 'SELECT name, age FROM users WHERE age > 26 ORDER BY age DESC');
26
- // rows: [["Carol",35],["Alice",30]]
58
+ // rows: [["Carol",35],["Alice",30]]
27
59
 
28
- await jsql.executeSQL(db, 'UPDATE users SET age = 31 WHERE id = 1');
29
- await jsql.executeSQL(db, 'DELETE FROM users WHERE id = 2');
30
60
  await db.stop();
31
61
  ```
32
62
 
33
- Supported: `CREATE/DROP TABLE`, `INSERT` (multi-row, `ON DUPLICATE KEY UPDATE`), `SELECT` (`WHERE`/`ORDER BY`/`LIMIT`/`OFFSET`/`GROUP BY`/`HAVING`/aggregates), `UPDATE`, `DELETE`, prepared statements with `?` placeholders.
63
+ Need a **MySQL server** instead?
34
64
 
35
- ## Redis-Style Storage Modes
65
+ ```bash
66
+ jsql serve -p 3306 --data-dir ./data
67
+ mysql -h 127.0.0.1 -P 3306 -u root # any MySQL client, now
68
+ ```
36
69
 
37
- Native and Pure JS engines support three persistence modes (Redis-compatible model: memory-first, async flush, LRU eviction, lazy reload):
70
+ Need a **Redis server**?
38
71
 
39
- ```js
40
- const db = new jsql.NativeJSQL({
41
- path: '/var/lib/jsql', // storage directory (required for hybrid/disk)
42
- mode: 'hybrid', // 'memory' (default) | 'hybrid' | 'disk'
43
- memReserveMB: 512, // keep 512MB RAM headroom before evicting
44
- flushInterval: 200, // ms between async flushes (hybrid 200 / disk 50)
45
- evictInterval: 1000, // ms between memory-pressure checks
46
- });
47
- await db.start();
72
+ ```bash
73
+ jsql redis -p 6379 --data-dir ./redis-data
74
+ redis-cli SET hello world
48
75
  ```
49
76
 
50
- - **`memory`** pure in-memory (default, no path needed)
51
- - **`hybrid`** — writes go to memory first, async incremental flush to disk; cold tables are LRU-evicted when memory pressure exceeds `total - memReserveMB`, and lazily reloaded on next access
52
- - **`disk`** — fast flush (50ms), memory acts as read/write cache
77
+ Need a **web console**?
53
78
 
54
- Data is stored per-table as `<dir>/<table>.jsql.json` + `meta.json`; writes are atomic (tmp + rename).
55
-
56
- ```js
57
- // Pure JS engine (same options)
58
- const db2 = new jsql.Database({ path: '/var/lib/jsql', mode: 'hybrid' });
79
+ ```bash
80
+ jsql ui -p 8080 --data-dir ./data # open http://localhost:8080
59
81
  ```
60
82
 
61
- ## Quick Start
83
+ One package. One install. Five doors in.
62
84
 
63
- ### Native (fastest)
85
+ ---
64
86
 
65
- ```js
66
- const { NativeJSQL } = require('jsql-neo');
67
- const db = new NativeJSQL();
68
- await db.start();
87
+ ## Engines
69
88
 
70
- await db.createTable('users', {
71
- name: { type: 'string' },
72
- age: { type: 'integer' }
73
- });
74
- const [id] = await db.insert('users', { name: 'Alice', age: 30 });
75
- const user = await db.findById('users', id);
76
- // { id: 1, fields: { name: 'Alice', age: 30 }, created_at: '...', updated_at: '...' }
77
- await db.stop();
78
- ```
89
+ | Engine | Entry point | Speed | Where it runs | Best for |
90
+ |--------|-------------|-------|---------------|----------|
91
+ | **Native** | `NativeJSQL` | ⚡ fastest (Rust N-API) | Node.js | Production, hot paths |
92
+ | **WASM** | `JSQL` | fast (Rust → wasm) | Node.js **and browsers** | Portability, edge, playgrounds |
93
+ | **Pure JS** | `Database` | solid | Node.js | Local JSON files, zero-native deploys |
94
+
95
+ All three share the same API `createTable` / `insert` / `findById` / `find` / `updateById` /
96
+ `removeById` / `dropTable` — plus a common `executeSQL()` SQL engine. **Write once, run anywhere.**
97
+
98
+ ### Storage modes (Native & Pure JS)
79
99
 
80
- ### Pure JS (local file)
100
+ | Mode | Behavior |
101
+ |------|----------|
102
+ | `memory` | Pure in-memory, max speed, no path needed |
103
+ | `hybrid` | Memory-first, async incremental flush, cold tables LRU-evicted under memory pressure, lazy reload |
104
+ | `disk` | Fast flush (50ms), memory as read/write cache |
81
105
 
82
106
  ```js
83
- const { Database } = require('jsql-neo');
84
- const db = new Database('/tmp/mydb.json'); // or { path, mode } for hybrid/disk
85
- const users = db.createTable('users', {
86
- id: { type: 'integer', autoIncrement: true, primaryKey: true },
87
- name: { type: 'string', length: 32 },
88
- age: { type: 'integer' }
107
+ const db = new jsql.NativeJSQL({
108
+ path: '/var/lib/jsql',
109
+ mode: 'hybrid', // 'memory' | 'hybrid' | 'disk'
110
+ memReserveMB: 512, // RAM headroom before LRU eviction
111
+ flushInterval: 200, // async flush cadence (ms)
89
112
  });
90
- const ids = users.insertMany([{ name: 'Alice', age: 30 }, { name: 'Bob', age: 25 }]);
91
- users.updateById(ids[0], { age: 31 });
92
- db.save();
93
113
  ```
94
114
 
95
- ## API
115
+ Atomic writes (tmp + rename), per-table files, and WAL + snapshot crash recovery on the server engine.
96
116
 
97
- | Method | Native | WASM | Pure JS | Description |
98
- |--------|--------|------|---------|-------------|
99
- | `createTable(name, schema)` | ✅ | ✅ | ✅ | Define table with typed fields |
100
- | `insert(table, data)` | ✅ | ✅ | ✅ | Insert row(s), returns IDs |
101
- | `findById(table, id)` | ✅ | ✅ | ✅ | O(1) PK lookup |
102
- | `find(table, filter?)` | ✅ | ✅ | ✅ | Filtered query with B-Tree index |
103
- | `count(table)` | ✅ | ✅ | ✅ | Row count |
104
- | `updateById(table, id, data)` | ✅ | ✅ | ✅ | O(1) PK update |
105
- | `removeById(table, id)` | ✅ | ✅ | ✅ | O(1) PK delete |
106
- | `dropTable(name)` | ✅ | ✅ | ✅ | Remove table |
107
- | `executeSQL(db, sql, params?)` | ✅ | ✅ | ✅ | Run SQL statements |
117
+ ---
108
118
 
109
- ## Schema Field Options
119
+ ## The SQL Engine
110
120
 
111
- ```js
112
- {
113
- type: 'string' | 'integer' | 'float' | 'boolean',
114
- primaryKey: true, // PK field (auto-indexed)
115
- autoIncrement: true, // Auto-generate integer PK
116
- length: 32, // Max string length
117
- default: 'value', // Default value
118
- nullable: true // Allow null
119
- }
121
+ A full SQL engine with prepared statements, joins, subqueries, and MySQL-compatible column naming:
122
+
123
+ ```sql
124
+ CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY AUTO_INCREMENT, name VARCHAR(50), age INTEGER)
125
+ INSERT INTO users (name, age) VALUES ('Alice', 30), ('Bob', 25) ON DUPLICATE KEY UPDATE age = 30
126
+ SELECT name, age FROM users WHERE age > 26 ORDER BY age DESC LIMIT 10 OFFSET 5
127
+ SELECT COUNT(*), AVG(age) FROM users GROUP BY dept HAVING COUNT(*) > 2
128
+ UPDATE users SET age = 31 WHERE name = 'Bob'
129
+ DELETE FROM users WHERE id = 2
130
+ BEGIN / COMMIT / ROLLBACK
120
131
  ```
121
132
 
122
- ## ORM Compatibility
133
+ Scalar functions: `VERSION()`, `NOW()`, `CONCAT()`, `IFNULL()`, `COALESCE()`, `UPPER()`, `LOWER()`,
134
+ `LENGTH()`, `ROUND()`, `LAST_INSERT_ID()`, `ROW_COUNT()`, `FOUND_ROWS()`, `CONNECTION_ID()`, `DATABASE()` …
135
+ System variables: `@@version`, `@@sql_mode`, `SET @@sql_mode = 'STRICT_TRANS_TABLES'` …
136
+
137
+ ---
138
+
139
+ ## Speak MySQL
123
140
 
124
- The MySQL-compatible server mode accepts standard MySQL clients, so popular Node.js ORMs work without a plugin. Tested against a live `createMysqlServer()` instance:
141
+ The MySQL wire-protocol server accepts **standard MySQL clients** no plugins, no middleware.
142
+ Verified in CI against the real drivers used by three major ORMs:
125
143
 
126
144
  | ORM | Version | Results |
127
145
  |-----|---------|---------|
128
- | [Sequelize](https://sequelize.org) | v6 | ✅ 10/10 — connect, authenticate, sync (CREATE TABLE), create, bulkCreate, find, count, update, destroy, MAX() |
129
- | [Knex](https://knexjs.org) | v3 | ✅ 9/9 — schema builder, insert, select, where + orderBy, count, update, delete, raw `SELECT VERSION()` |
146
+ | [Sequelize](https://sequelize.org) | v6 | ✅ 10/10 — connect, authenticate, sync, create, bulkCreate, find, count, update, destroy, MAX() |
147
+ | [Knex](https://knexjs.org) | v3 | ✅ 9/9 — schema builder, insert, select, where + orderBy, count, update, delete, raw SQL |
130
148
  | [TypeORM](https://typeorm.io) | v0.3 | ✅ 8/8 — initialize, synchronize, save, findOne, find, count, update, delete |
131
149
 
132
- ```js
133
- // Sequelize
134
- const { Sequelize, DataTypes } = require('sequelize');
135
- const sequelize = new Sequelize('default', 'root', '', {
136
- host: '127.0.0.1', port: 33306, dialect: 'mysql',
137
- });
150
+ Also verified with `mysql2/promise` over the wire: prepared statements (`COM_STMT_PREPARE`/`EXECUTE`),
151
+ binary protocol result sets, `SHOW COLUMNS` / `SHOW INDEX` / `SHOW CREATE TABLE` / `SHOW VARIABLES` /
152
+ `SHOW GRANTS`, `information_schema`, `START TRANSACTION`, `TRUNCATE TABLE`, `SET` statements, and
153
+ MySQL DDL forms (`int unsigned`, `auto_increment`, `ENGINE=InnoDB`, `DEFAULT CHARSET`).
138
154
 
139
- // Knex
140
- const knex = require('knex')({
141
- client: 'mysql2',
142
- connection: { host: '127.0.0.1', port: 33306, user: 'root', database: 'default' },
143
- });
144
-
145
- // TypeORM
146
- const ds = new DataSource({
147
- type: 'mysql',
148
- host: '127.0.0.1', port: 33306, username: 'root', database: 'default',
149
- synchronize: true, entities: [User],
150
- });
155
+ ```js
156
+ const { createMysqlServer } = require('jsql-neo');
157
+ createMysqlServer({ port: 3306, dataDir: './data', noAuth: true }).listen();
151
158
  ```
152
159
 
153
- Supported for ORM compatibility: prepared statements (`COM_STMT_PREPARE`/`EXECUTE`), binary protocol result sets, `SHOW COLUMNS` / `SHOW INDEX` / `SHOW CREATE TABLE` / `SHOW VARIABLES` / `SHOW GRANTS`, `information_schema` queries, `START TRANSACTION`, `TRUNCATE TABLE`, `SET` statements, scalar functions (`VERSION()`, `NOW()`, `CONCAT()`, `IFNULL()`, ...), and MySQL DDL forms (`int unsigned`, `auto_increment`, `ENGINE=InnoDB`, `DEFAULT CHARSET`).
160
+ ---
154
161
 
155
- ## Redis-compatible server
162
+ ## Speak Redis
163
+
164
+ A RESP2 server that plays perfectly with `ioredis`, `node-redis`, and `redis-cli`:
156
165
 
157
- ```bash
158
- jsql redis -p 6379 --data-dir ./redis-data [--auth secret]
166
+ ```
167
+ PING ECHO SET GET SETNX DEL EXISTS KEYS TYPE EXPIRE TTL PERSIST
168
+ INCR DECR INCRBY DECRBY APPEND STRLEN
169
+ HSET HGET HGETALL HDEL HEXISTS HLEN HKEYS HVALS
170
+ LPUSH RPUSH LPOP RPOP LLEN LRANGE LINDEX LREM
171
+ SADD SREM SMEMBERS SISMEMBER SCARD
172
+ DBSIZE FLUSHALL FLUSHDB SELECT INFO AUTH QUIT
159
173
  ```
160
174
 
161
- or from code:
175
+ Snapshot persistence to `data.rdb.json` — debounced writes (500ms) plus a guaranteed flush on shutdown.
162
176
 
163
177
  ```js
164
178
  const { createRedisServer } = require('jsql-neo');
165
179
  createRedisServer({ port: 6379, dataDir: './redis-data' }).listen();
166
180
  ```
167
181
 
168
- Speaks RESP2 (works with `redis-cli` / ioredis / node-redis). Strings, hashes, lists, sets, counters, TTL, `KEYS`/`EXISTS`/`DEL`, multi-select DBs, `AUTH`, and snapshot persistence to `data.rdb.json` (debounced 500ms + on shutdown).
182
+ ---
169
183
 
170
- ## Web UI
184
+ ## Toolbox — everything included
171
185
 
172
- ```bash
173
- jsql ui -p 8080 --data-dir ./data # then open http://localhost:8080
174
- ```
186
+ ### CLI (`jsql`)
175
187
 
176
- or from code: `new WebUI({ port: 8080, dataDir: './data' }).start()`. Zero-dependency management console: browse databases/tables, run SQL in the browser.
188
+ | Command | What it does |
189
+ |---------|--------------|
190
+ | `jsql serve` | Run the MySQL-compatible server in the foreground |
191
+ | `jsql server start\|stop\|status` | Background daemon with pid control |
192
+ | `jsql redis` | Run the Redis-compatible server |
193
+ | `jsql ui` | Serve the built-in web management console |
194
+ | `jsql import <dump.sql\|.json\|.csv>` | Load a mysqldump, JSON, or CSV file |
195
+ | `jsql export <table> <file>` | Dump a table to JSON or CSV |
196
+ | `jsql bench` | Insert + query benchmark against a data dir |
197
+ | `jsql mod` | Plugin registry (enable / disable / list) |
198
+ | `jsql version` | Print version |
177
199
 
178
- ## CLI
200
+ ### Web UI (`WebUI`)
179
201
 
180
- `jsql serve` (foreground MySQL server), `jsql server start|stop|status` (background daemon), `jsql import <dump.sql|.json|.csv>`, `jsql export <table> <file>`, `jsql bench`, `jsql redis`, `jsql ui`, `jsql mod` (plugin registry), `jsql version`.
202
+ A zero-dependency HTTP management console: browse databases and tables, run SQL in the browser,
203
+ see results as a table. Perfect for dev tools, admin panels, and demos.
181
204
 
182
- ## Browser playground
205
+ ### Migration tools (`migrate`)
183
206
 
184
- `examples/playground/` is a self-contained SQL playground that runs the full engine in the browser (WASM + IndexedDB, no server):
207
+ ```js
208
+ const { importDumpFile, exportToFile, importFromCSV, exportAllToJSON } = require('jsql-neo');
209
+ await importDumpFile(db, './backup.sql', { strict: true }); // real mysqldump format
210
+ await exportToFile(db, 'users', './users.csv'); // CSV round-trip
211
+ ```
212
+
213
+ ### Browser playground
214
+
215
+ `examples/playground/` is a self-contained SQL sandbox — the **entire engine runs in your browser**
216
+ (WASM + IndexedDB persistence, no server):
185
217
 
186
218
  ```bash
187
219
  cd examples/playground && npm install && npm run dev
188
220
  ```
189
221
 
190
- ## Testing
222
+ ### TypeScript
191
223
 
192
- ```bash
193
- npm test # zero-dependency SQL engine smoke tests
194
- npm run test:orms # ORM compatibility suites (start examples/orms/start-server.js first)
195
- ```
224
+ Full declarations ship with the package (`index.d.ts` + `wasm/browser.d.ts`), verified with
225
+ `tsc --strict`. Autocomplete your way through every engine, server, and tool.
196
226
 
197
- The ORM suites in `examples/orms/` run Sequelize (10/10), Knex (9/9) and TypeORM (8/8) against a live MySQL-compatible server.
227
+ ---
198
228
 
199
229
  ## Benchmark
200
230
 
231
+ 100,000 rows — insert / point query / range query / count / update (Linux x64, Node 24):
232
+
233
+ | Engine | Insert/s | Point query (500×) | Range query (500×) | Total |
234
+ |--------|----------|--------------------|--------------------|-------|
235
+ | **Native (Rust N-API)** | 0.66M | 930ms | 685ms | **1.77s** 🏆 |
236
+ | better-sqlite3 (WAL) | 0.40M | 3258ms | 149ms | 3.66s |
237
+ | sql.js (WASM sqlite) | 0.30M | 5852ms | 366ms | 6.57s |
238
+ | Pure JS engine | 0.38M | 11278ms | 18138ms | 29.7s |
239
+
240
+ **~2× faster than better-sqlite3. ~17× faster than a pure-JS engine.** Reproduce it yourself:
241
+
201
242
  ```bash
202
243
  cd bench && npm install && npm run bench
203
244
  ```
204
245
 
205
- `bench/bench.js` compares the four engines on 100k rows (insert / point query / range query / count / update):
246
+ ---
206
247
 
207
- | Engine | Insert/s | Point query (500x) | Range query (500x) | Total |
208
- |--------|----------|--------------------|--------------------|-------|
209
- | **Native** (Rust N-API) | 0.66M | 930ms | 685ms | **1.77s** |
210
- | better-sqlite3 (WAL) | 0.40M | 3258ms | 149ms | 3.66s |
211
- | sql.js (WASM sqlite) | 0.30M | 5852ms | 366ms | 6.57s |
212
- | Pure JS | 0.38M | 11278ms | 18138ms | 29.7s |
213
-
214
- Native is ~2x faster than better-sqlite3 and ~17x faster than the pure-JS engine overall (Linux x64 / Node 24). Full breakdown: `bench/report.md`.
215
-
216
- ## Features
217
-
218
- - Three engines: Native (N-API Rust), WASM (wasm-pack Rust), Pure JS (local JSON)
219
- - SQL engine with prepared statements
220
- - Redis-style hybrid/disk storage: memory-first + async flush + LRU eviction + lazy reload
221
- - O(1) primary key hash index (`FxHashMap` / `Map`)
222
- - B-Tree indexing for range queries
223
- - WAL + snapshot crash recovery (server engine)
224
- - Batch insert / update / delete
225
- - Cursor-based pagination
226
- - Transaction support (server engine)
227
- - Built-in web management UI (`jsql ui` / `new WebUI(...)`): browse databases & tables, run SQL from the browser
228
- - CLI: `jsql serve|server|import|export|bench|ui|mod|version`
229
- - Migration tools: mysqldump import, JSON/CSV export/import
248
+ ## API at a glance
249
+
250
+ | Method | Native | WASM | Pure JS | Notes |
251
+ |--------|:------:|:----:|:-------:|-------|
252
+ | `createTable(name, schema)` | | | | Typed fields, indexes |
253
+ | `insert(table, data)` | | | | Batch supported, returns IDs |
254
+ | `findById(table, id)` | ✅ | ✅ | ✅ | O(1) primary-key hash lookup |
255
+ | `find(table, filter, opts)` | | | | Filter + B-Tree range scan, pagination |
256
+ | `count(table)` | ✅ | ✅ | ✅ | — |
257
+ | `updateById(table, id, data)` | ✅ | ✅ | ✅ | O(1) PK update |
258
+ | `removeById(table, id)` | ✅ | ✅ | ✅ | O(1) PK delete |
259
+ | `executeSQL(db, sql, params)` | | | ✅ | Full SQL engine, prepared statements |
260
+
261
+ ```js
262
+ {
263
+ type: 'string' | 'integer' | 'float' | 'boolean',
264
+ primaryKey: true, // auto-indexed
265
+ autoIncrement: true, // integer PK generation
266
+ length: 32, // string max length
267
+ default: 'value',
268
+ nullable: true
269
+ }
270
+ ```
271
+
272
+ ---
273
+
274
+ ## Testing
275
+
276
+ ```bash
277
+ npm test # zero-dependency SQL engine smoke suite
278
+ npm run test:orms # ORM compatibility (start examples/orms/start-server.js first)
279
+ ```
280
+
281
+ CI (`.github/workflows/ci.yml`): engine smoke tests on Node 18/20/22 + a full ORM compatibility job.
282
+
283
+ ---
284
+
285
+ ## License
286
+
287
+ MIT — use it, ship it, love it.
288
+
289
+ *JSQL-NEO: Rust-powered. Protocol-native. One package.*
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsql-neo",
3
- "version": "4.4.0",
3
+ "version": "4.4.1",
4
4
  "description": "JSQL-NEO — Rust-powered embedded database with WASM, REST API, B-Tree indexes, WAL, crash recovery",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",