@objectstack/driver-memory 0.1.0 → 0.1.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/CHANGELOG.md +9 -0
- package/dist/src/memory-driver.d.ts +1 -0
- package/dist/src/memory-driver.js +6 -0
- package/package.json +2 -2
- package/src/memory-driver.ts +7 -0
package/CHANGELOG.md
ADDED
|
@@ -8,6 +8,7 @@ import { DriverInterface, DriverOptions, QueryInput } from '@objectstack/spec';
|
|
|
8
8
|
export declare class InMemoryDriver implements DriverInterface {
|
|
9
9
|
name: string;
|
|
10
10
|
version: string;
|
|
11
|
+
install(ctx: any): void;
|
|
11
12
|
supports: {
|
|
12
13
|
transactions: boolean;
|
|
13
14
|
joins: boolean;
|
|
@@ -23,6 +23,12 @@ class InMemoryDriver {
|
|
|
23
23
|
*/
|
|
24
24
|
this.db = {};
|
|
25
25
|
}
|
|
26
|
+
// Duck-typed RuntimePlugin hook
|
|
27
|
+
install(ctx) {
|
|
28
|
+
if (ctx.engine && ctx.engine.ql && typeof ctx.engine.ql.registerDriver === 'function') {
|
|
29
|
+
ctx.engine.ql.registerDriver(this);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
26
32
|
// ===================================
|
|
27
33
|
// Lifecycle
|
|
28
34
|
// ===================================
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@objectstack/driver-memory",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "In-Memory Driver for ObjectStack (Reference Implementation)",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@objectstack/spec": "0.1.
|
|
8
|
+
"@objectstack/spec": "0.1.2"
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"typescript": "^5.0.0"
|
package/src/memory-driver.ts
CHANGED
|
@@ -14,6 +14,13 @@ import {
|
|
|
14
14
|
export class InMemoryDriver implements DriverInterface {
|
|
15
15
|
name = 'in-memory-driver';
|
|
16
16
|
version = '0.0.1';
|
|
17
|
+
|
|
18
|
+
// Duck-typed RuntimePlugin hook
|
|
19
|
+
install(ctx: any) {
|
|
20
|
+
if (ctx.engine && ctx.engine.ql && typeof ctx.engine.ql.registerDriver === 'function') {
|
|
21
|
+
ctx.engine.ql.registerDriver(this);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
17
24
|
|
|
18
25
|
supports = {
|
|
19
26
|
transactions: false,
|