jsql-neo 5.4.2 → 5.5.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 +202 -202
- package/README.md +8097 -7971
- package/bin/jsql +320 -320
- package/bin/jsql-server +90 -90
- package/bin/jsql-server-control.js +177 -177
- package/index.d.ts +385 -357
- package/index.js +124 -118
- package/lib/ast.js +214 -0
- package/lib/btree.js +413 -413
- package/lib/cache.js +328 -328
- package/lib/client.js +125 -125
- package/lib/database.js +1744 -1744
- package/lib/date-types.js +182 -182
- package/lib/errors.js +89 -89
- package/lib/jsql_format.js +497 -497
- package/lib/migrate.js +254 -254
- package/lib/mod.js +292 -292
- package/lib/mongo_server.js +607 -607
- package/lib/multiserver.js +140 -140
- package/lib/mysql_compat.js +413 -413
- package/lib/mysql_server.js +1237 -1237
- package/lib/native_client.js +732 -732
- package/lib/nedb_compat.js +506 -506
- package/lib/pg_server.js +864 -864
- package/lib/plugin.js +34 -34
- package/lib/query.js +815 -815
- package/lib/redis_server.js +571 -571
- package/lib/sql.js +3460 -2925
- package/lib/sqlite_compat.js +323 -323
- package/lib/sqlite_worker.js +264 -264
- package/lib/table.js +1304 -1304
- package/lib/tui.js +502 -502
- package/lib/wasm.js +1 -1
- package/lib/wasm_client.js +718 -718
- package/lib/web_ui.js +257 -257
- package/native/jsql-neo-native.node +0 -0
- package/nativesrc/jsql-neo-core/Cargo.lock +455 -455
- package/nativesrc/jsql-neo-core/Cargo.toml +24 -24
- package/nativesrc/jsql-neo-core/src/engine/hybrid.rs +455 -455
- package/nativesrc/jsql-neo-core/src/engine/memory.rs +168 -168
- package/nativesrc/jsql-neo-core/src/engine/mod.rs +62 -62
- package/nativesrc/jsql-neo-core/src/engine/table.rs +700 -700
- package/nativesrc/jsql-neo-core/src/lib.rs +2 -2
- package/nativesrc/jsql-neo-core/src/storage/mod.rs +2 -2
- package/nativesrc/jsql-neo-core/src/storage/persistent.rs +1 -1
- package/nativesrc/jsql-neo-core/src/storage/wal.rs +85 -85
- package/nativesrc/jsql-neo-core/src/types.rs +93 -93
- package/nativesrc/jsql-neo-native/Cargo.lock +606 -606
- package/nativesrc/jsql-neo-native/Cargo.toml +16 -16
- package/nativesrc/jsql-neo-native/build.rs +3 -3
- package/nativesrc/jsql-neo-native/package.json +7 -7
- package/nativesrc/jsql-neo-native/src/lib.rs +269 -269
- package/nativesrc/jsql-neo-wasm/Cargo.lock +465 -465
- package/nativesrc/jsql-neo-wasm/Cargo.toml +15 -15
- package/nativesrc/jsql-neo-wasm/src/lib.rs +447 -447
- package/package.json +87 -86
- package/postinstall.js +158 -158
- package/test/btree.test.js +128 -128
- package/test/coverage.js +187 -187
- package/test/join.test.js +110 -110
- package/test/native.test.js +158 -158
- package/test/regress-5.1.0.js +271 -271
- package/test/smoke.js +58 -58
- package/test/sql-parser.test.js +273 -0
- package/test/wasm.test.js +110 -110
- package/wasm/browser.d.ts +89 -89
- package/wasm/browser.mjs +569 -569
- package/wasm/browser_bg.mjs +597 -597
- package/wasm/jsql_neo_wasm.d.ts +38 -38
- package/wasm/jsql_neo_wasm.js +520 -520
- package/wasm/jsql_neo_wasm_bg.wasm.d.ts +26 -26
- package/wasm/package.json +11 -11
package/lib/plugin.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
class Plugin {
|
|
2
|
-
constructor(name, opts = {}) {
|
|
3
|
-
this.name = name;
|
|
4
|
-
this.hooks = opts.hooks || {};
|
|
5
|
-
this._onEvent = opts.onEvent || null;
|
|
6
|
-
this._install = opts.install || null;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
onEvent(fn) {
|
|
10
|
-
this._onEvent = fn;
|
|
11
|
-
return this;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
on(hook, fn) {
|
|
15
|
-
this.hooks[hook] = fn;
|
|
16
|
-
return this;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
install(fn) {
|
|
20
|
-
this._install = fn;
|
|
21
|
-
return this;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
build() {
|
|
25
|
-
const inst = {
|
|
26
|
-
name: this.name,
|
|
27
|
-
hooks: this.hooks
|
|
28
|
-
};
|
|
29
|
-
if (this._onEvent) inst.onEvent = this._onEvent;
|
|
30
|
-
if (this._install) inst.install = this._install;
|
|
31
|
-
return inst;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
1
|
+
class Plugin {
|
|
2
|
+
constructor(name, opts = {}) {
|
|
3
|
+
this.name = name;
|
|
4
|
+
this.hooks = opts.hooks || {};
|
|
5
|
+
this._onEvent = opts.onEvent || null;
|
|
6
|
+
this._install = opts.install || null;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
onEvent(fn) {
|
|
10
|
+
this._onEvent = fn;
|
|
11
|
+
return this;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
on(hook, fn) {
|
|
15
|
+
this.hooks[hook] = fn;
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
install(fn) {
|
|
20
|
+
this._install = fn;
|
|
21
|
+
return this;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
build() {
|
|
25
|
+
const inst = {
|
|
26
|
+
name: this.name,
|
|
27
|
+
hooks: this.hooks
|
|
28
|
+
};
|
|
29
|
+
if (this._onEvent) inst.onEvent = this._onEvent;
|
|
30
|
+
if (this._install) inst.install = this._install;
|
|
31
|
+
return inst;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
35
|
module.exports = { Plugin };
|