@orkestrel/database 0.0.18 → 0.0.19
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/src/browser/index.js +59 -45
- package/dist/src/browser/index.js.map +1 -1
- package/dist/src/core/index.cjs +219 -233
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +65 -11
- package/dist/src/core/index.d.ts +65 -11
- package/dist/src/core/index.js +218 -235
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +225 -219
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.d.cts +49 -0
- package/dist/src/server/index.d.ts +49 -0
- package/dist/src/server/index.js +225 -222
- package/dist/src/server/index.js.map +1 -1
- package/package.json +20 -20
|
@@ -6,6 +6,7 @@ import type { DriverInterface } from '@orkestrel/database';
|
|
|
6
6
|
import type { DriverMetadata } from '@orkestrel/database';
|
|
7
7
|
import type { FieldPath } from '@orkestrel/contract';
|
|
8
8
|
import type { Key } from '@orkestrel/database';
|
|
9
|
+
import type { MemoryDriver } from '@orkestrel/database';
|
|
9
10
|
import type { MigrationInput } from '@orkestrel/database';
|
|
10
11
|
import type { MigrationStep } from '@orkestrel/database';
|
|
11
12
|
import type { OperationOptions } from '@orkestrel/database';
|
|
@@ -26,6 +27,17 @@ import type { TableSchema } from '@orkestrel/database';
|
|
|
26
27
|
*/
|
|
27
28
|
export declare function compileAggregateSQL(operation: AggregateOperation, column: FieldPath): string;
|
|
28
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Encodes condition operands for a SQL fragment using their declared or inferred storage.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* compileBoundSQL('"age" > ?', [18], false, undefined)
|
|
36
|
+
* // { sql: '"age" > ?', parameters: ['18'] }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare function compileBoundSQL(sql: string, values: readonly unknown[], nested: boolean, declared: ColumnSchema | undefined): CompiledSQL;
|
|
40
|
+
|
|
29
41
|
/**
|
|
30
42
|
* Maps a portable {@link ColumnStorage} to its SQLite column type.
|
|
31
43
|
*
|
|
@@ -621,6 +633,26 @@ export declare class JSONDriver implements DriverInterface {
|
|
|
621
633
|
migrate(input: MigrationInput): Promise<void>;
|
|
622
634
|
}
|
|
623
635
|
|
|
636
|
+
/**
|
|
637
|
+
* Owns the isolated memory store and schema of one JSON transaction.
|
|
638
|
+
*
|
|
639
|
+
* @example
|
|
640
|
+
* ```ts
|
|
641
|
+
* const transaction = new JSONTransaction(new MemoryDriver(), [], new Map())
|
|
642
|
+
* transaction.stop()
|
|
643
|
+
* // transaction.memory throws CONFLICT after settlement.
|
|
644
|
+
* ```
|
|
645
|
+
*/
|
|
646
|
+
export declare class JSONTransaction {
|
|
647
|
+
#private;
|
|
648
|
+
constructor(memory: MemoryDriver, schema: readonly TableSchema[], identities: ReadonlyMap<string, object>);
|
|
649
|
+
get memory(): MemoryDriver;
|
|
650
|
+
get schema(): readonly TableSchema[];
|
|
651
|
+
get identities(): ReadonlyMap<string, object>;
|
|
652
|
+
project(schema: readonly TableSchema[], identities: ReadonlyMap<string, object>): void;
|
|
653
|
+
stop(): void;
|
|
654
|
+
}
|
|
655
|
+
|
|
624
656
|
/**
|
|
625
657
|
* Reports whether a caught filesystem error says that nothing is there to read.
|
|
626
658
|
*
|
|
@@ -955,6 +987,23 @@ export declare interface SQLiteDriverOptions {
|
|
|
955
987
|
readonly pragmas?: Readonly<Record<string, string | number>>;
|
|
956
988
|
}
|
|
957
989
|
|
|
990
|
+
/**
|
|
991
|
+
* Owns the candidate schema and table identities of one SQLite transaction.
|
|
992
|
+
*
|
|
993
|
+
* @example
|
|
994
|
+
* ```ts
|
|
995
|
+
* const transaction = new SQLiteTransaction(new Map(), new Map())
|
|
996
|
+
* transaction.schema.size // 0
|
|
997
|
+
* ```
|
|
998
|
+
*/
|
|
999
|
+
export declare class SQLiteTransaction {
|
|
1000
|
+
#private;
|
|
1001
|
+
constructor(schema: ReadonlyMap<string, TableSchema>, identities: ReadonlyMap<string, object>);
|
|
1002
|
+
get schema(): ReadonlyMap<string, TableSchema>;
|
|
1003
|
+
get identities(): ReadonlyMap<string, object>;
|
|
1004
|
+
project(schema: readonly TableSchema[], identities: ReadonlyMap<string, object>): void;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
958
1007
|
/**
|
|
959
1008
|
* Projects one {@link MigrationStep} to SQLite DDL.
|
|
960
1009
|
*
|
|
@@ -6,6 +6,7 @@ import type { DriverInterface } from '@orkestrel/database';
|
|
|
6
6
|
import type { DriverMetadata } from '@orkestrel/database';
|
|
7
7
|
import type { FieldPath } from '@orkestrel/contract';
|
|
8
8
|
import type { Key } from '@orkestrel/database';
|
|
9
|
+
import type { MemoryDriver } from '@orkestrel/database';
|
|
9
10
|
import type { MigrationInput } from '@orkestrel/database';
|
|
10
11
|
import type { MigrationStep } from '@orkestrel/database';
|
|
11
12
|
import type { OperationOptions } from '@orkestrel/database';
|
|
@@ -26,6 +27,17 @@ import type { TableSchema } from '@orkestrel/database';
|
|
|
26
27
|
*/
|
|
27
28
|
export declare function compileAggregateSQL(operation: AggregateOperation, column: FieldPath): string;
|
|
28
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Encodes condition operands for a SQL fragment using their declared or inferred storage.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* compileBoundSQL('"age" > ?', [18], false, undefined)
|
|
36
|
+
* // { sql: '"age" > ?', parameters: ['18'] }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare function compileBoundSQL(sql: string, values: readonly unknown[], nested: boolean, declared: ColumnSchema | undefined): CompiledSQL;
|
|
40
|
+
|
|
29
41
|
/**
|
|
30
42
|
* Maps a portable {@link ColumnStorage} to its SQLite column type.
|
|
31
43
|
*
|
|
@@ -621,6 +633,26 @@ export declare class JSONDriver implements DriverInterface {
|
|
|
621
633
|
migrate(input: MigrationInput): Promise<void>;
|
|
622
634
|
}
|
|
623
635
|
|
|
636
|
+
/**
|
|
637
|
+
* Owns the isolated memory store and schema of one JSON transaction.
|
|
638
|
+
*
|
|
639
|
+
* @example
|
|
640
|
+
* ```ts
|
|
641
|
+
* const transaction = new JSONTransaction(new MemoryDriver(), [], new Map())
|
|
642
|
+
* transaction.stop()
|
|
643
|
+
* // transaction.memory throws CONFLICT after settlement.
|
|
644
|
+
* ```
|
|
645
|
+
*/
|
|
646
|
+
export declare class JSONTransaction {
|
|
647
|
+
#private;
|
|
648
|
+
constructor(memory: MemoryDriver, schema: readonly TableSchema[], identities: ReadonlyMap<string, object>);
|
|
649
|
+
get memory(): MemoryDriver;
|
|
650
|
+
get schema(): readonly TableSchema[];
|
|
651
|
+
get identities(): ReadonlyMap<string, object>;
|
|
652
|
+
project(schema: readonly TableSchema[], identities: ReadonlyMap<string, object>): void;
|
|
653
|
+
stop(): void;
|
|
654
|
+
}
|
|
655
|
+
|
|
624
656
|
/**
|
|
625
657
|
* Reports whether a caught filesystem error says that nothing is there to read.
|
|
626
658
|
*
|
|
@@ -955,6 +987,23 @@ export declare interface SQLiteDriverOptions {
|
|
|
955
987
|
readonly pragmas?: Readonly<Record<string, string | number>>;
|
|
956
988
|
}
|
|
957
989
|
|
|
990
|
+
/**
|
|
991
|
+
* Owns the candidate schema and table identities of one SQLite transaction.
|
|
992
|
+
*
|
|
993
|
+
* @example
|
|
994
|
+
* ```ts
|
|
995
|
+
* const transaction = new SQLiteTransaction(new Map(), new Map())
|
|
996
|
+
* transaction.schema.size // 0
|
|
997
|
+
* ```
|
|
998
|
+
*/
|
|
999
|
+
export declare class SQLiteTransaction {
|
|
1000
|
+
#private;
|
|
1001
|
+
constructor(schema: ReadonlyMap<string, TableSchema>, identities: ReadonlyMap<string, object>);
|
|
1002
|
+
get schema(): ReadonlyMap<string, TableSchema>;
|
|
1003
|
+
get identities(): ReadonlyMap<string, object>;
|
|
1004
|
+
project(schema: readonly TableSchema[], identities: ReadonlyMap<string, object>): void;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
958
1007
|
/**
|
|
959
1008
|
* Projects one {@link MigrationStep} to SQLite DDL.
|
|
960
1009
|
*
|