@bjornpagen/bumbledb 1.3.0 → 1.3.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/COOKBOOK.md +72 -19
- package/README.md +9 -6
- package/dist/changes.d.ts +0 -1
- package/dist/changes.d.ts.map +1 -1
- package/dist/changes.js +2 -8
- package/dist/changes.js.map +1 -1
- package/dist/codec.d.ts +8 -1
- package/dist/codec.d.ts.map +1 -1
- package/dist/codec.js +29 -2
- package/dist/codec.js.map +1 -1
- package/dist/db-native.d.ts +2 -9
- package/dist/db-native.d.ts.map +1 -1
- package/dist/db-native.js.map +1 -1
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/internal/log.d.ts +4 -4
- package/dist/internal/log.d.ts.map +1 -1
- package/dist/internal/log.js +2 -2
- package/dist/internal/log.js.map +1 -1
- package/dist/native.d.ts +9 -9
- package/dist/native.d.ts.map +1 -1
- package/dist/query/compute.d.ts +3 -3
- package/dist/query/compute.d.ts.map +1 -1
- package/dist/query/compute.js +3 -12
- package/dist/query/compute.js.map +1 -1
- package/dist/query/description.js +4 -4
- package/dist/query/description.js.map +1 -1
- package/dist/query/lower.d.ts +11 -2
- package/dist/query/lower.d.ts.map +1 -1
- package/dist/query/lower.js +31 -26
- package/dist/query/lower.js.map +1 -1
- package/dist/query/parse-ir.d.ts.map +1 -1
- package/dist/query/parse-ir.js +4 -4
- package/dist/query/parse-ir.js.map +1 -1
- package/dist/query/scope.d.ts.map +1 -1
- package/dist/query/scope.js +6 -1
- package/dist/query/scope.js.map +1 -1
- package/dist/runtime-codes.d.ts +1 -1
- package/dist/runtime-codes.d.ts.map +1 -1
- package/dist/runtime-codes.js +1 -0
- package/dist/runtime-codes.js.map +1 -1
- package/dist/runtime-errors.d.ts +23 -3
- package/dist/runtime-errors.d.ts.map +1 -1
- package/dist/runtime-errors.js +16 -3
- package/dist/runtime-errors.js.map +1 -1
- package/dist/runtime-native.d.ts +3 -8
- package/dist/runtime-native.d.ts.map +1 -1
- package/dist/runtime-native.js.map +1 -1
- package/dist/runtime.d.ts +0 -23
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +0 -36
- package/dist/runtime.js.map +1 -1
- package/dist/scalar.d.ts +34 -104
- package/dist/scalar.d.ts.map +1 -1
- package/dist/scalar.js +12 -177
- package/dist/scalar.js.map +1 -1
- package/dist/schema-file.d.ts +7 -0
- package/dist/schema-file.d.ts.map +1 -0
- package/dist/schema-file.js +24 -0
- package/dist/schema-file.js.map +1 -0
- package/pack-provenance.json +4 -4
- package/package.json +4 -4
- package/src/changes.ts +2 -8
- package/src/codec.ts +43 -3
- package/src/db-native.ts +2 -10
- package/src/index.ts +11 -5
- package/src/internal/log.ts +2 -4
- package/src/native.ts +7 -7
- package/src/query/compute.ts +6 -15
- package/src/query/description.ts +4 -4
- package/src/query/lower.ts +56 -25
- package/src/query/parse-ir.ts +6 -4
- package/src/query/scope.ts +8 -1
- package/src/runtime-codes.ts +1 -0
- package/src/runtime-errors.ts +16 -3
- package/src/runtime-native.ts +1 -9
- package/src/runtime.ts +1 -70
- package/src/scalar.ts +49 -329
- package/src/schema-file.ts +38 -0
- package/dist/migration.d.ts +0 -31
- package/dist/migration.d.ts.map +0 -1
- package/dist/migration.js +0 -47
- package/dist/migration.js.map +0 -1
- package/src/migration.ts +0 -61
package/dist/migration.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Private log-migration integration entrypoints: the two read-only
|
|
3
|
-
* native migration-codec verbs the `@bjornpagen/bumbledb-log/migrations`
|
|
4
|
-
* generator imports, wired over the shared executor onto the native
|
|
5
|
-
* `schema_file`, `migration::plan` and `migration::manifest` modules.
|
|
6
|
-
*
|
|
7
|
-
* Both follow `hashChunk`'s shape: bounded owned input, bounded owned JSON
|
|
8
|
-
* response bytes, ONE registered cancellable operation under the acquired
|
|
9
|
-
* `NativeRuntime`. The schema verb takes the SDK `SchemaSpec` object — the
|
|
10
|
-
* same wire that already crosses the bridge for open/create — never a
|
|
11
|
-
* respelled text form. Neither verb opens, initializes, freezes or migrates
|
|
12
|
-
* a database; the durable migrate/activate/abort workflow is the log's
|
|
13
|
-
* admin surface, not this seam.
|
|
14
|
-
*/
|
|
15
|
-
import { Effect } from "effect";
|
|
16
|
-
import { dbNative } from "#db-native.ts";
|
|
17
|
-
import { nativeOperationWith, runtimeHandle } from "#runtime.ts";
|
|
18
|
-
import { DbError, dbError } from "#runtime-errors.ts";
|
|
19
|
-
function owned(operation, value) {
|
|
20
|
-
if (value === null) {
|
|
21
|
-
throw dbError(operation, { _tag: "Internal" });
|
|
22
|
-
}
|
|
23
|
-
return value;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Canonical schema admission for the migration generator: validates the
|
|
27
|
-
* spec natively and yields bounded JSON bytes carrying the canonical
|
|
28
|
-
* `schemaId` and the rendered schema snapshot.
|
|
29
|
-
*/
|
|
30
|
-
const internalMigrationSchema = Effect.fn("internalMigrationSchema")(function* (spec) {
|
|
31
|
-
const runtime = yield* runtimeHandle();
|
|
32
|
-
return yield* nativeOperationWith("internalMigrationSchema", (callback) => dbNative.runtimeMigrationSchema(runtime, spec, callback), dbNative.runtimeBytesTake, (bytes) => owned("internalMigrationSchema", bytes));
|
|
33
|
-
});
|
|
34
|
-
/**
|
|
35
|
-
* One bounded read-only migration-codec request (plan parse/validate/
|
|
36
|
-
* render/digest, manifest verify/append preview, plan-set digests): owned
|
|
37
|
-
* JSON request bytes in, owned JSON response bytes out.
|
|
38
|
-
*/
|
|
39
|
-
const internalMigrationRead = Effect.fn("internalMigrationRead")(function* (request) {
|
|
40
|
-
if (!(request instanceof Uint8Array) || !(request.buffer instanceof ArrayBuffer)) {
|
|
41
|
-
return yield* Effect.fail(new DbError({ operation: "internalMigrationRead", reason: { _tag: "InvalidArgument" } }));
|
|
42
|
-
}
|
|
43
|
-
const runtime = yield* runtimeHandle();
|
|
44
|
-
return yield* nativeOperationWith("internalMigrationRead", (callback) => dbNative.runtimeMigrationRead(runtime, request, callback), dbNative.runtimeBytesTake, (bytes) => owned("internalMigrationRead", bytes));
|
|
45
|
-
});
|
|
46
|
-
export { internalMigrationRead, internalMigrationSchema };
|
|
47
|
-
//# sourceMappingURL=migration.js.map
|
package/dist/migration.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migration.js","sourceRoot":"","sources":["../src/migration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAGrD,SAAS,KAAK,CAAC,SAAiB,EAAE,KAAwB;IACzD,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACpB,MAAM,OAAO,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAA;IAC/C,CAAC;IACD,OAAO,KAAK,CAAA;AACb,CAAC;AAED;;;;GAIG;AACH,MAAM,uBAAuB,GAAG,MAAM,CAAC,EAAE,CAAC,yBAAyB,CAAC,CAAC,QAAQ,CAAC,EAAE,IAAgB;IAC/F,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,aAAa,EAAE,CAAA;IACtC,OAAO,KAAK,CAAC,CAAC,mBAAmB,CAChC,yBAAyB,EACzB,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,EACtE,QAAQ,CAAC,gBAAgB,EACzB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAClD,CAAA;AACF,CAAC,CAAC,CAAA;AAEF;;;;GAIG;AACH,MAAM,qBAAqB,GAAG,MAAM,CAAC,EAAE,CAAC,uBAAuB,CAAC,CAAC,QAAQ,CAAC,EAAE,OAAmB;IAC9F,IAAI,CAAC,CAAC,OAAO,YAAY,UAAU,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,YAAY,WAAW,CAAC,EAAE,CAAC;QAClF,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,EAAE,SAAS,EAAE,uBAAuB,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,EAAE,CAAC,CAAC,CAAA;IACpH,CAAC;IACD,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,aAAa,EAAE,CAAA;IACtC,OAAO,KAAK,CAAC,CAAC,mBAAmB,CAChC,uBAAuB,EACvB,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EACvE,QAAQ,CAAC,gBAAgB,EACzB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAChD,CAAA;AACF,CAAC,CAAC,CAAA;AAEF,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,CAAA"}
|
package/src/migration.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Private log-migration integration entrypoints: the two read-only
|
|
3
|
-
* native migration-codec verbs the `@bjornpagen/bumbledb-log/migrations`
|
|
4
|
-
* generator imports, wired over the shared executor onto the native
|
|
5
|
-
* `schema_file`, `migration::plan` and `migration::manifest` modules.
|
|
6
|
-
*
|
|
7
|
-
* Both follow `hashChunk`'s shape: bounded owned input, bounded owned JSON
|
|
8
|
-
* response bytes, ONE registered cancellable operation under the acquired
|
|
9
|
-
* `NativeRuntime`. The schema verb takes the SDK `SchemaSpec` object — the
|
|
10
|
-
* same wire that already crosses the bridge for open/create — never a
|
|
11
|
-
* respelled text form. Neither verb opens, initializes, freezes or migrates
|
|
12
|
-
* a database; the durable migrate/activate/abort workflow is the log's
|
|
13
|
-
* admin surface, not this seam.
|
|
14
|
-
*/
|
|
15
|
-
import { Effect } from "effect"
|
|
16
|
-
import { dbNative } from "#db-native.ts"
|
|
17
|
-
import { nativeOperationWith, runtimeHandle } from "#runtime.ts"
|
|
18
|
-
import { DbError, dbError } from "#runtime-errors.ts"
|
|
19
|
-
import type { SchemaSpec } from "#spec.ts"
|
|
20
|
-
|
|
21
|
-
function owned(operation: string, value: Uint8Array | null): Uint8Array {
|
|
22
|
-
if (value === null) {
|
|
23
|
-
throw dbError(operation, { _tag: "Internal" })
|
|
24
|
-
}
|
|
25
|
-
return value
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Canonical schema admission for the migration generator: validates the
|
|
30
|
-
* spec natively and yields bounded JSON bytes carrying the canonical
|
|
31
|
-
* `schemaId` and the rendered schema snapshot.
|
|
32
|
-
*/
|
|
33
|
-
const internalMigrationSchema = Effect.fn("internalMigrationSchema")(function* (spec: SchemaSpec) {
|
|
34
|
-
const runtime = yield* runtimeHandle()
|
|
35
|
-
return yield* nativeOperationWith(
|
|
36
|
-
"internalMigrationSchema",
|
|
37
|
-
(callback) => dbNative.runtimeMigrationSchema(runtime, spec, callback),
|
|
38
|
-
dbNative.runtimeBytesTake,
|
|
39
|
-
(bytes) => owned("internalMigrationSchema", bytes)
|
|
40
|
-
)
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* One bounded read-only migration-codec request (plan parse/validate/
|
|
45
|
-
* render/digest, manifest verify/append preview, plan-set digests): owned
|
|
46
|
-
* JSON request bytes in, owned JSON response bytes out.
|
|
47
|
-
*/
|
|
48
|
-
const internalMigrationRead = Effect.fn("internalMigrationRead")(function* (request: Uint8Array) {
|
|
49
|
-
if (!(request instanceof Uint8Array) || !(request.buffer instanceof ArrayBuffer)) {
|
|
50
|
-
return yield* Effect.fail(new DbError({ operation: "internalMigrationRead", reason: { _tag: "InvalidArgument" } }))
|
|
51
|
-
}
|
|
52
|
-
const runtime = yield* runtimeHandle()
|
|
53
|
-
return yield* nativeOperationWith(
|
|
54
|
-
"internalMigrationRead",
|
|
55
|
-
(callback) => dbNative.runtimeMigrationRead(runtime, request, callback),
|
|
56
|
-
dbNative.runtimeBytesTake,
|
|
57
|
-
(bytes) => owned("internalMigrationRead", bytes)
|
|
58
|
-
)
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
export { internalMigrationRead, internalMigrationSchema }
|