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.
- package/README.md +210 -150
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,229 +1,289 @@
|
|
|
1
|
-
# JSQL-NEO
|
|
1
|
+
# JSQL-NEO
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
6
|
+

|
|
7
|
+

|
|
8
|
+

|
|
9
|
+

|
|
10
|
+

|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Why JSQL-NEO?
|
|
6
15
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
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
|
-
//
|
|
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
|
-
|
|
63
|
+
Need a **MySQL server** instead?
|
|
34
64
|
|
|
35
|
-
|
|
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
|
-
|
|
70
|
+
Need a **Redis server**?
|
|
38
71
|
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
83
|
+
One package. One install. Five doors in.
|
|
62
84
|
|
|
63
|
-
|
|
85
|
+
---
|
|
64
86
|
|
|
65
|
-
|
|
66
|
-
const { NativeJSQL } = require('jsql-neo');
|
|
67
|
-
const db = new NativeJSQL();
|
|
68
|
-
await db.start();
|
|
87
|
+
## Engines
|
|
69
88
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
|
|
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
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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
|
-
|
|
115
|
+
Atomic writes (tmp + rename), per-table files, and WAL + snapshot crash recovery on the server engine.
|
|
96
116
|
|
|
97
|
-
|
|
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
|
-
##
|
|
119
|
+
## The SQL Engine
|
|
110
120
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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
|
-
|
|
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-
|
|
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
|
|
129
|
-
| [Knex](https://knexjs.org) | v3 | ✅ 9/9 — schema builder, insert, select, where + orderBy, count, update, delete, raw
|
|
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
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
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
|
-
|
|
140
|
-
const
|
|
141
|
-
|
|
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
|
-
|
|
160
|
+
---
|
|
154
161
|
|
|
155
|
-
## Redis
|
|
162
|
+
## Speak Redis
|
|
163
|
+
|
|
164
|
+
A RESP2 server that plays perfectly with `ioredis`, `node-redis`, and `redis-cli`:
|
|
156
165
|
|
|
157
|
-
```
|
|
158
|
-
|
|
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
|
-
|
|
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
|
-
|
|
182
|
+
---
|
|
169
183
|
|
|
170
|
-
##
|
|
184
|
+
## Toolbox — everything included
|
|
171
185
|
|
|
172
|
-
|
|
173
|
-
jsql ui -p 8080 --data-dir ./data # then open http://localhost:8080
|
|
174
|
-
```
|
|
186
|
+
### CLI (`jsql`)
|
|
175
187
|
|
|
176
|
-
|
|
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
|
-
|
|
200
|
+
### Web UI (`WebUI`)
|
|
179
201
|
|
|
180
|
-
|
|
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
|
-
|
|
205
|
+
### Migration tools (`migrate`)
|
|
183
206
|
|
|
184
|
-
|
|
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
|
-
|
|
222
|
+
### TypeScript
|
|
191
223
|
|
|
192
|
-
|
|
193
|
-
|
|
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
|
-
|
|
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
|
-
|
|
246
|
+
---
|
|
206
247
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
|
210
|
-
|
|
211
|
-
|
|
|
212
|
-
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
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.*
|