omniql 1.0.0 → 1.0.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/dist/libomniql.dylib +0 -0
- package/dist/libomniql.so +0 -0
- package/dist/omniql.d.ts +1 -0
- package/dist/omniql.dll +0 -0
- package/dist/omniql.js +6 -0
- package/package.json +1 -1
package/dist/libomniql.dylib
CHANGED
|
Binary file
|
package/dist/libomniql.so
CHANGED
|
Binary file
|
package/dist/omniql.d.ts
CHANGED
|
@@ -53,5 +53,6 @@ export declare class OmniEngine {
|
|
|
53
53
|
registerSQLiteDriver(dsn: string): string;
|
|
54
54
|
registerPostgresDriver(connStr: string): string;
|
|
55
55
|
registerMongoDriver(uri: string, dbName: string): string;
|
|
56
|
+
batchInsert<T = Record<string, unknown>>(target: string, docs: Record<string, unknown>[]): Promise<OmniResult<T>>;
|
|
56
57
|
close(): void;
|
|
57
58
|
}
|
package/dist/omniql.dll
CHANGED
|
Binary file
|
package/dist/omniql.js
CHANGED
|
@@ -100,6 +100,12 @@ class OmniEngine {
|
|
|
100
100
|
const raw = bridge.registerMongoDriver(this.handle, uri, dbName);
|
|
101
101
|
return JSON.parse(raw).driver ?? 'mongo';
|
|
102
102
|
}
|
|
103
|
+
async batchInsert(target, docs) {
|
|
104
|
+
const payload = { target, action: 'BATCH_INSERT', documents: docs };
|
|
105
|
+
const json = JSON.stringify(payload);
|
|
106
|
+
const rawResponse = bridge.execute(this.handle, json);
|
|
107
|
+
return JSON.parse(rawResponse);
|
|
108
|
+
}
|
|
103
109
|
close() {
|
|
104
110
|
bridge.freeEngine(this.handle);
|
|
105
111
|
}
|