@proseql/core 0.1.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 +21 -0
- package/dist/errors/crud-errors.d.ts +98 -0
- package/dist/errors/crud-errors.d.ts.map +1 -0
- package/dist/errors/crud-errors.js +23 -0
- package/dist/errors/crud-errors.js.map +1 -0
- package/dist/errors/index.d.ts +16 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +12 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/errors/migration-errors.d.ts +22 -0
- package/dist/errors/migration-errors.d.ts.map +1 -0
- package/dist/errors/migration-errors.js +14 -0
- package/dist/errors/migration-errors.js.map +1 -0
- package/dist/errors/plugin-errors.d.ts +15 -0
- package/dist/errors/plugin-errors.d.ts.map +1 -0
- package/dist/errors/plugin-errors.js +11 -0
- package/dist/errors/plugin-errors.js.map +1 -0
- package/dist/errors/query-errors.d.ts +31 -0
- package/dist/errors/query-errors.d.ts.map +1 -0
- package/dist/errors/query-errors.js +11 -0
- package/dist/errors/query-errors.js.map +1 -0
- package/dist/errors/storage-errors.d.ts +30 -0
- package/dist/errors/storage-errors.d.ts.map +1 -0
- package/dist/errors/storage-errors.js +11 -0
- package/dist/errors/storage-errors.js.map +1 -0
- package/dist/factories/crud-factory-with-relationships.d.ts +28 -0
- package/dist/factories/crud-factory-with-relationships.d.ts.map +1 -0
- package/dist/factories/crud-factory-with-relationships.js +8 -0
- package/dist/factories/crud-factory-with-relationships.js.map +1 -0
- package/dist/factories/crud-factory.d.ts +25 -0
- package/dist/factories/crud-factory.d.ts.map +1 -0
- package/dist/factories/crud-factory.js +8 -0
- package/dist/factories/crud-factory.js.map +1 -0
- package/dist/factories/database-effect.d.ts +241 -0
- package/dist/factories/database-effect.d.ts.map +1 -0
- package/dist/factories/database-effect.js +859 -0
- package/dist/factories/database-effect.js.map +1 -0
- package/dist/hooks/hook-runner.d.ts +60 -0
- package/dist/hooks/hook-runner.d.ts.map +1 -0
- package/dist/hooks/hook-runner.js +107 -0
- package/dist/hooks/hook-runner.js.map +1 -0
- package/dist/index.d.ts +84 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +110 -0
- package/dist/index.js.map +1 -0
- package/dist/indexes/index-lookup.d.ts +33 -0
- package/dist/indexes/index-lookup.d.ts.map +1 -0
- package/dist/indexes/index-lookup.js +180 -0
- package/dist/indexes/index-lookup.js.map +1 -0
- package/dist/indexes/index-manager.d.ts +118 -0
- package/dist/indexes/index-manager.d.ts.map +1 -0
- package/dist/indexes/index-manager.js +345 -0
- package/dist/indexes/index-manager.js.map +1 -0
- package/dist/indexes/search-index.d.ts +179 -0
- package/dist/indexes/search-index.d.ts.map +1 -0
- package/dist/indexes/search-index.js +405 -0
- package/dist/indexes/search-index.js.map +1 -0
- package/dist/migrations/migration-runner.d.ts +70 -0
- package/dist/migrations/migration-runner.d.ts.map +1 -0
- package/dist/migrations/migration-runner.js +271 -0
- package/dist/migrations/migration-runner.js.map +1 -0
- package/dist/migrations/migration-types.d.ts +63 -0
- package/dist/migrations/migration-types.d.ts.map +1 -0
- package/dist/migrations/migration-types.js +5 -0
- package/dist/migrations/migration-types.js.map +1 -0
- package/dist/operations/crud/create-with-relationships.d.ts +44 -0
- package/dist/operations/crud/create-with-relationships.d.ts.map +1 -0
- package/dist/operations/crud/create-with-relationships.js +483 -0
- package/dist/operations/crud/create-with-relationships.js.map +1 -0
- package/dist/operations/crud/create.d.ts +48 -0
- package/dist/operations/crud/create.d.ts.map +1 -0
- package/dist/operations/crud/create.js +333 -0
- package/dist/operations/crud/create.js.map +1 -0
- package/dist/operations/crud/delete-with-relationships.d.ts +63 -0
- package/dist/operations/crud/delete-with-relationships.d.ts.map +1 -0
- package/dist/operations/crud/delete-with-relationships.js +395 -0
- package/dist/operations/crud/delete-with-relationships.js.map +1 -0
- package/dist/operations/crud/delete.d.ts +58 -0
- package/dist/operations/crud/delete.d.ts.map +1 -0
- package/dist/operations/crud/delete.js +267 -0
- package/dist/operations/crud/delete.js.map +1 -0
- package/dist/operations/crud/unique-check.d.ts +114 -0
- package/dist/operations/crud/unique-check.d.ts.map +1 -0
- package/dist/operations/crud/unique-check.js +383 -0
- package/dist/operations/crud/unique-check.js.map +1 -0
- package/dist/operations/crud/update-with-relationships.d.ts +45 -0
- package/dist/operations/crud/update-with-relationships.d.ts.map +1 -0
- package/dist/operations/crud/update-with-relationships.js +516 -0
- package/dist/operations/crud/update-with-relationships.js.map +1 -0
- package/dist/operations/crud/update.d.ts +91 -0
- package/dist/operations/crud/update.d.ts.map +1 -0
- package/dist/operations/crud/update.js +505 -0
- package/dist/operations/crud/update.js.map +1 -0
- package/dist/operations/crud/upsert.d.ts +52 -0
- package/dist/operations/crud/upsert.d.ts.map +1 -0
- package/dist/operations/crud/upsert.js +386 -0
- package/dist/operations/crud/upsert.js.map +1 -0
- package/dist/operations/query/aggregate.d.ts +30 -0
- package/dist/operations/query/aggregate.d.ts.map +1 -0
- package/dist/operations/query/aggregate.js +227 -0
- package/dist/operations/query/aggregate.js.map +1 -0
- package/dist/operations/query/cursor-stream.d.ts +18 -0
- package/dist/operations/query/cursor-stream.d.ts.map +1 -0
- package/dist/operations/query/cursor-stream.js +199 -0
- package/dist/operations/query/cursor-stream.js.map +1 -0
- package/dist/operations/query/filter-stream.d.ts +12 -0
- package/dist/operations/query/filter-stream.d.ts.map +1 -0
- package/dist/operations/query/filter-stream.js +167 -0
- package/dist/operations/query/filter-stream.js.map +1 -0
- package/dist/operations/query/filter.d.ts +13 -0
- package/dist/operations/query/filter.d.ts.map +1 -0
- package/dist/operations/query/filter.js +267 -0
- package/dist/operations/query/filter.js.map +1 -0
- package/dist/operations/query/paginate-stream.d.ts +11 -0
- package/dist/operations/query/paginate-stream.d.ts.map +1 -0
- package/dist/operations/query/paginate-stream.js +22 -0
- package/dist/operations/query/paginate-stream.js.map +1 -0
- package/dist/operations/query/query-helpers.d.ts +14 -0
- package/dist/operations/query/query-helpers.d.ts.map +1 -0
- package/dist/operations/query/query-helpers.js +22 -0
- package/dist/operations/query/query-helpers.js.map +1 -0
- package/dist/operations/query/resolve-computed.d.ts +142 -0
- package/dist/operations/query/resolve-computed.d.ts.map +1 -0
- package/dist/operations/query/resolve-computed.js +197 -0
- package/dist/operations/query/resolve-computed.js.map +1 -0
- package/dist/operations/query/search.d.ts +110 -0
- package/dist/operations/query/search.d.ts.map +1 -0
- package/dist/operations/query/search.js +188 -0
- package/dist/operations/query/search.js.map +1 -0
- package/dist/operations/query/select-stream.d.ts +27 -0
- package/dist/operations/query/select-stream.d.ts.map +1 -0
- package/dist/operations/query/select-stream.js +88 -0
- package/dist/operations/query/select-stream.js.map +1 -0
- package/dist/operations/query/select.d.ts +54 -0
- package/dist/operations/query/select.d.ts.map +1 -0
- package/dist/operations/query/select.js +159 -0
- package/dist/operations/query/select.js.map +1 -0
- package/dist/operations/query/sort-stream.d.ts +46 -0
- package/dist/operations/query/sort-stream.d.ts.map +1 -0
- package/dist/operations/query/sort-stream.js +158 -0
- package/dist/operations/query/sort-stream.js.map +1 -0
- package/dist/operations/query/sort.d.ts +9 -0
- package/dist/operations/query/sort.d.ts.map +1 -0
- package/dist/operations/query/sort.js +58 -0
- package/dist/operations/query/sort.js.map +1 -0
- package/dist/operations/relationships/populate-stream.d.ts +29 -0
- package/dist/operations/relationships/populate-stream.d.ts.map +1 -0
- package/dist/operations/relationships/populate-stream.js +159 -0
- package/dist/operations/relationships/populate-stream.js.map +1 -0
- package/dist/operations/relationships/populate.d.ts +15 -0
- package/dist/operations/relationships/populate.d.ts.map +1 -0
- package/dist/operations/relationships/populate.js +228 -0
- package/dist/operations/relationships/populate.js.map +1 -0
- package/dist/plugins/plugin-hooks.d.ts +25 -0
- package/dist/plugins/plugin-hooks.d.ts.map +1 -0
- package/dist/plugins/plugin-hooks.js +64 -0
- package/dist/plugins/plugin-hooks.js.map +1 -0
- package/dist/plugins/plugin-registry.d.ts +26 -0
- package/dist/plugins/plugin-registry.d.ts.map +1 -0
- package/dist/plugins/plugin-registry.js +150 -0
- package/dist/plugins/plugin-registry.js.map +1 -0
- package/dist/plugins/plugin-types.d.ts +95 -0
- package/dist/plugins/plugin-types.d.ts.map +1 -0
- package/dist/plugins/plugin-types.js +6 -0
- package/dist/plugins/plugin-types.js.map +1 -0
- package/dist/plugins/plugin-validation.d.ts +49 -0
- package/dist/plugins/plugin-validation.d.ts.map +1 -0
- package/dist/plugins/plugin-validation.js +295 -0
- package/dist/plugins/plugin-validation.js.map +1 -0
- package/dist/reactive/change-event.d.ts +44 -0
- package/dist/reactive/change-event.d.ts.map +1 -0
- package/dist/reactive/change-event.js +49 -0
- package/dist/reactive/change-event.js.map +1 -0
- package/dist/reactive/change-pubsub.d.ts +32 -0
- package/dist/reactive/change-pubsub.d.ts.map +1 -0
- package/dist/reactive/change-pubsub.js +31 -0
- package/dist/reactive/change-pubsub.js.map +1 -0
- package/dist/reactive/evaluate-query.d.ts +62 -0
- package/dist/reactive/evaluate-query.d.ts.map +1 -0
- package/dist/reactive/evaluate-query.js +57 -0
- package/dist/reactive/evaluate-query.js.map +1 -0
- package/dist/reactive/watch-by-id.d.ts +53 -0
- package/dist/reactive/watch-by-id.d.ts.map +1 -0
- package/dist/reactive/watch-by-id.js +55 -0
- package/dist/reactive/watch-by-id.js.map +1 -0
- package/dist/reactive/watch.d.ts +78 -0
- package/dist/reactive/watch.d.ts.map +1 -0
- package/dist/reactive/watch.js +133 -0
- package/dist/reactive/watch.js.map +1 -0
- package/dist/serializers/codecs/hjson.d.ts +33 -0
- package/dist/serializers/codecs/hjson.d.ts.map +1 -0
- package/dist/serializers/codecs/hjson.js +40 -0
- package/dist/serializers/codecs/hjson.js.map +1 -0
- package/dist/serializers/codecs/json.d.ts +22 -0
- package/dist/serializers/codecs/json.d.ts.map +1 -0
- package/dist/serializers/codecs/json.js +28 -0
- package/dist/serializers/codecs/json.js.map +1 -0
- package/dist/serializers/codecs/json5.d.ts +26 -0
- package/dist/serializers/codecs/json5.d.ts.map +1 -0
- package/dist/serializers/codecs/json5.js +33 -0
- package/dist/serializers/codecs/json5.js.map +1 -0
- package/dist/serializers/codecs/jsonc.d.ts +29 -0
- package/dist/serializers/codecs/jsonc.d.ts.map +1 -0
- package/dist/serializers/codecs/jsonc.js +38 -0
- package/dist/serializers/codecs/jsonc.js.map +1 -0
- package/dist/serializers/codecs/jsonl.d.ts +17 -0
- package/dist/serializers/codecs/jsonl.d.ts.map +1 -0
- package/dist/serializers/codecs/jsonl.js +31 -0
- package/dist/serializers/codecs/jsonl.js.map +1 -0
- package/dist/serializers/codecs/prose.d.ts +419 -0
- package/dist/serializers/codecs/prose.d.ts.map +1 -0
- package/dist/serializers/codecs/prose.js +1060 -0
- package/dist/serializers/codecs/prose.js.map +1 -0
- package/dist/serializers/codecs/toml.d.ts +23 -0
- package/dist/serializers/codecs/toml.d.ts.map +1 -0
- package/dist/serializers/codecs/toml.js +66 -0
- package/dist/serializers/codecs/toml.js.map +1 -0
- package/dist/serializers/codecs/toon.d.ts +20 -0
- package/dist/serializers/codecs/toon.d.ts.map +1 -0
- package/dist/serializers/codecs/toon.js +33 -0
- package/dist/serializers/codecs/toon.js.map +1 -0
- package/dist/serializers/codecs/yaml.d.ts +24 -0
- package/dist/serializers/codecs/yaml.d.ts.map +1 -0
- package/dist/serializers/codecs/yaml.js +31 -0
- package/dist/serializers/codecs/yaml.js.map +1 -0
- package/dist/serializers/format-codec.d.ts +53 -0
- package/dist/serializers/format-codec.d.ts.map +1 -0
- package/dist/serializers/format-codec.js +148 -0
- package/dist/serializers/format-codec.js.map +1 -0
- package/dist/serializers/presets.d.ts +48 -0
- package/dist/serializers/presets.d.ts.map +1 -0
- package/dist/serializers/presets.js +72 -0
- package/dist/serializers/presets.js.map +1 -0
- package/dist/serializers/serializer-service.d.ts +11 -0
- package/dist/serializers/serializer-service.d.ts.map +1 -0
- package/dist/serializers/serializer-service.js +4 -0
- package/dist/serializers/serializer-service.js.map +1 -0
- package/dist/state/collection-state.d.ts +19 -0
- package/dist/state/collection-state.d.ts.map +1 -0
- package/dist/state/collection-state.js +15 -0
- package/dist/state/collection-state.js.map +1 -0
- package/dist/state/state-operations.d.ts +38 -0
- package/dist/state/state-operations.d.ts.map +1 -0
- package/dist/state/state-operations.js +65 -0
- package/dist/state/state-operations.js.map +1 -0
- package/dist/storage/in-memory-adapter-layer.d.ts +16 -0
- package/dist/storage/in-memory-adapter-layer.d.ts.map +1 -0
- package/dist/storage/in-memory-adapter-layer.js +81 -0
- package/dist/storage/in-memory-adapter-layer.js.map +1 -0
- package/dist/storage/persistence-effect.d.ts +244 -0
- package/dist/storage/persistence-effect.d.ts.map +1 -0
- package/dist/storage/persistence-effect.js +551 -0
- package/dist/storage/persistence-effect.js.map +1 -0
- package/dist/storage/storage-service.d.ts +22 -0
- package/dist/storage/storage-service.d.ts.map +1 -0
- package/dist/storage/storage-service.js +4 -0
- package/dist/storage/storage-service.js.map +1 -0
- package/dist/storage/transforms.d.ts +183 -0
- package/dist/storage/transforms.d.ts.map +1 -0
- package/dist/storage/transforms.js +263 -0
- package/dist/storage/transforms.js.map +1 -0
- package/dist/transactions/transaction.d.ts +87 -0
- package/dist/transactions/transaction.d.ts.map +1 -0
- package/dist/transactions/transaction.js +240 -0
- package/dist/transactions/transaction.js.map +1 -0
- package/dist/types/aggregate-types.d.ts +73 -0
- package/dist/types/aggregate-types.d.ts.map +1 -0
- package/dist/types/aggregate-types.js +14 -0
- package/dist/types/aggregate-types.js.map +1 -0
- package/dist/types/computed-types.d.ts +71 -0
- package/dist/types/computed-types.d.ts.map +1 -0
- package/dist/types/computed-types.js +8 -0
- package/dist/types/computed-types.js.map +1 -0
- package/dist/types/crud-relationship-types.d.ts +180 -0
- package/dist/types/crud-relationship-types.d.ts.map +1 -0
- package/dist/types/crud-relationship-types.js +17 -0
- package/dist/types/crud-relationship-types.js.map +1 -0
- package/dist/types/crud-types.d.ts +343 -0
- package/dist/types/crud-types.d.ts.map +1 -0
- package/dist/types/crud-types.js +43 -0
- package/dist/types/crud-types.js.map +1 -0
- package/dist/types/cursor-types.d.ts +52 -0
- package/dist/types/cursor-types.d.ts.map +1 -0
- package/dist/types/cursor-types.js +2 -0
- package/dist/types/cursor-types.js.map +1 -0
- package/dist/types/database-config-types.d.ts +196 -0
- package/dist/types/database-config-types.d.ts.map +1 -0
- package/dist/types/database-config-types.js +11 -0
- package/dist/types/database-config-types.js.map +1 -0
- package/dist/types/hook-types.d.ts +158 -0
- package/dist/types/hook-types.d.ts.map +1 -0
- package/dist/types/hook-types.js +6 -0
- package/dist/types/hook-types.js.map +1 -0
- package/dist/types/index-types.d.ts +42 -0
- package/dist/types/index-types.d.ts.map +1 -0
- package/dist/types/index-types.js +8 -0
- package/dist/types/index-types.js.map +1 -0
- package/dist/types/operators.d.ts +5 -0
- package/dist/types/operators.d.ts.map +1 -0
- package/dist/types/operators.js +297 -0
- package/dist/types/operators.js.map +1 -0
- package/dist/types/query-overloads.d.ts +54 -0
- package/dist/types/query-overloads.d.ts.map +1 -0
- package/dist/types/query-overloads.js +3 -0
- package/dist/types/query-overloads.js.map +1 -0
- package/dist/types/reactive-types.d.ts +75 -0
- package/dist/types/reactive-types.d.ts.map +1 -0
- package/dist/types/reactive-types.js +7 -0
- package/dist/types/reactive-types.js.map +1 -0
- package/dist/types/schema-types.d.ts +56 -0
- package/dist/types/schema-types.d.ts.map +1 -0
- package/dist/types/schema-types.js +8 -0
- package/dist/types/schema-types.js.map +1 -0
- package/dist/types/search-types.d.ts +82 -0
- package/dist/types/search-types.d.ts.map +1 -0
- package/dist/types/search-types.js +110 -0
- package/dist/types/search-types.js.map +1 -0
- package/dist/types/types.d.ts +286 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/types/types.js +2 -0
- package/dist/types/types.js.map +1 -0
- package/dist/utils/id-generator.d.ts +97 -0
- package/dist/utils/id-generator.d.ts.map +1 -0
- package/dist/utils/id-generator.js +247 -0
- package/dist/utils/id-generator.js.map +1 -0
- package/dist/utils/nested-path.d.ts +56 -0
- package/dist/utils/nested-path.d.ts.map +1 -0
- package/dist/utils/nested-path.js +119 -0
- package/dist/utils/nested-path.js.map +1 -0
- package/dist/utils/path.d.ts +16 -0
- package/dist/utils/path.d.ts.map +1 -0
- package/dist/utils/path.js +24 -0
- package/dist/utils/path.js.map +1 -0
- package/dist/validators/foreign-key.d.ts +49 -0
- package/dist/validators/foreign-key.d.ts.map +1 -0
- package/dist/validators/foreign-key.js +153 -0
- package/dist/validators/foreign-key.js.map +1 -0
- package/dist/validators/schema-validator.d.ts +19 -0
- package/dist/validators/schema-validator.d.ts.map +1 -0
- package/dist/validators/schema-validator.js +34 -0
- package/dist/validators/schema-validator.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Effect-based database factory.
|
|
3
|
+
*
|
|
4
|
+
* Creates an in-memory database with typed collections, each backed by
|
|
5
|
+
* Ref<ReadonlyMap<string, T>> for O(1) ID lookup and atomic state updates.
|
|
6
|
+
*
|
|
7
|
+
* Query pipeline: Ref snapshot → Stream.fromIterable → filter → populate → sort → paginate → select
|
|
8
|
+
* CRUD: Effect-based operations with typed error channels
|
|
9
|
+
* Persistence: Optional debounced save after each CRUD mutation via Effect.fork
|
|
10
|
+
*/
|
|
11
|
+
import { Effect, Schema, type Scope, Stream } from "effect";
|
|
12
|
+
import { type DuplicateKeyError, type ForeignKeyError, type HookError, NotFoundError, OperationError, type TransactionError, type UniqueConstraintError, ValidationError } from "../errors/crud-errors.js";
|
|
13
|
+
import type { MigrationError } from "../errors/migration-errors.js";
|
|
14
|
+
import type { PluginError } from "../errors/plugin-errors.js";
|
|
15
|
+
import type { DanglingReferenceError } from "../errors/query-errors.js";
|
|
16
|
+
import type { SerializationError, StorageError, UnsupportedFormatError } from "../errors/storage-errors.js";
|
|
17
|
+
import type { DryRunResult } from "../migrations/migration-types.js";
|
|
18
|
+
import type { ProseQLPlugin } from "../plugins/plugin-types.js";
|
|
19
|
+
import { type FormatCodec } from "../serializers/format-codec.js";
|
|
20
|
+
import { SerializerRegistry } from "../serializers/serializer-service.js";
|
|
21
|
+
import { StorageAdapter } from "../storage/storage-service.js";
|
|
22
|
+
import { type AggregateConfig, type AggregateResult, type GroupedAggregateResult } from "../types/aggregate-types.js";
|
|
23
|
+
import type { CreateWithRelationshipsInput, DeleteWithRelationshipsOptions, DeleteWithRelationshipsResult, UpdateWithRelationshipsInput } from "../types/crud-relationship-types.js";
|
|
24
|
+
import type { CreateInput, CreateManyOptions, CreateManyResult, DeleteManyResult, MinimalEntity, TransactionContext, UpdateManyResult, UpdateWithOperators, UpsertInput, UpsertManyResult, UpsertResult } from "../types/crud-types.js";
|
|
25
|
+
import type { CursorConfig, RunnableCursorPage } from "../types/cursor-types.js";
|
|
26
|
+
import type { DatabaseConfig } from "../types/database-config-types.js";
|
|
27
|
+
import type { GenerateDatabase, GenerateDatabaseWithPersistence, RelationshipDef } from "../types/types.js";
|
|
28
|
+
/**
|
|
29
|
+
* An Effect with a lazy `runPromise` getter for non-Effect consumers.
|
|
30
|
+
* Accessing `.runPromise` runs the effect and returns a Promise.
|
|
31
|
+
*/
|
|
32
|
+
export type RunnableEffect<A, E> = Effect.Effect<A, E, never> & {
|
|
33
|
+
readonly runPromise: Promise<A>;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* A Stream with a lazy `runPromise` getter for non-Effect consumers.
|
|
37
|
+
* Accessing `.runPromise` collects the stream into an array and returns a Promise.
|
|
38
|
+
*/
|
|
39
|
+
export type RunnableStream<A, E> = Stream.Stream<A, E, never> & {
|
|
40
|
+
readonly runPromise: Promise<ReadonlyArray<A>>;
|
|
41
|
+
};
|
|
42
|
+
type HasId = {
|
|
43
|
+
readonly id: string;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Shape of a single Effect-based collection.
|
|
47
|
+
* Query returns a RunnableStream (or RunnableCursorPage when cursor is specified),
|
|
48
|
+
* CRUD methods return RunnableEffects.
|
|
49
|
+
* Both have a `.runPromise` getter for non-Effect consumers.
|
|
50
|
+
*/
|
|
51
|
+
export interface EffectCollection<T extends HasId> {
|
|
52
|
+
readonly query: (options?: {
|
|
53
|
+
readonly where?: Record<string, unknown>;
|
|
54
|
+
readonly populate?: Record<string, unknown>;
|
|
55
|
+
readonly sort?: Record<string, "asc" | "desc">;
|
|
56
|
+
readonly select?: Record<string, unknown> | ReadonlyArray<string>;
|
|
57
|
+
readonly limit?: number;
|
|
58
|
+
readonly offset?: number;
|
|
59
|
+
readonly cursor?: CursorConfig;
|
|
60
|
+
}) => RunnableStream<Record<string, unknown>, DanglingReferenceError | ValidationError> | RunnableCursorPage<Record<string, unknown>, DanglingReferenceError | ValidationError>;
|
|
61
|
+
readonly findById: (id: string) => RunnableEffect<T, NotFoundError>;
|
|
62
|
+
readonly create: (input: CreateInput<T>) => RunnableEffect<T, ValidationError | DuplicateKeyError | ForeignKeyError | HookError | UniqueConstraintError>;
|
|
63
|
+
readonly createMany: (inputs: ReadonlyArray<CreateInput<T>>, options?: CreateManyOptions) => RunnableEffect<CreateManyResult<T>, ValidationError | DuplicateKeyError | ForeignKeyError | HookError | UniqueConstraintError>;
|
|
64
|
+
readonly update: (id: string, updates: UpdateWithOperators<T & MinimalEntity>) => RunnableEffect<T, ValidationError | NotFoundError | ForeignKeyError | HookError | UniqueConstraintError>;
|
|
65
|
+
readonly updateMany: (predicate: (entity: T) => boolean, updates: UpdateWithOperators<T & MinimalEntity>) => RunnableEffect<UpdateManyResult<T>, ValidationError | ForeignKeyError | HookError | UniqueConstraintError>;
|
|
66
|
+
readonly delete: (id: string, options?: {
|
|
67
|
+
readonly soft?: boolean;
|
|
68
|
+
}) => RunnableEffect<T, NotFoundError | OperationError | ForeignKeyError | HookError>;
|
|
69
|
+
readonly deleteMany: (predicate: (entity: T) => boolean, options?: {
|
|
70
|
+
readonly soft?: boolean;
|
|
71
|
+
readonly limit?: number;
|
|
72
|
+
}) => RunnableEffect<DeleteManyResult<T>, OperationError | ForeignKeyError | HookError>;
|
|
73
|
+
readonly upsert: (input: UpsertInput<T>) => RunnableEffect<UpsertResult<T>, ValidationError | ForeignKeyError | HookError | UniqueConstraintError>;
|
|
74
|
+
readonly upsertMany: (inputs: ReadonlyArray<UpsertInput<T>>) => RunnableEffect<UpsertManyResult<T>, ValidationError | ForeignKeyError | HookError | UniqueConstraintError>;
|
|
75
|
+
readonly createWithRelationships: (input: CreateWithRelationshipsInput<T, Record<string, RelationshipDef>>) => RunnableEffect<T, ValidationError | ForeignKeyError | OperationError>;
|
|
76
|
+
readonly updateWithRelationships: (id: string, input: UpdateWithRelationshipsInput<T, Record<string, RelationshipDef>>) => RunnableEffect<T, ValidationError | NotFoundError | ForeignKeyError | OperationError>;
|
|
77
|
+
readonly deleteWithRelationships: (id: string, options?: DeleteWithRelationshipsOptions<T, Record<string, RelationshipDef>>) => RunnableEffect<DeleteWithRelationshipsResult<T>, NotFoundError | ValidationError | OperationError>;
|
|
78
|
+
readonly deleteManyWithRelationships: (predicate: (entity: T) => boolean, options?: DeleteWithRelationshipsOptions<T, Record<string, RelationshipDef>> & {
|
|
79
|
+
readonly limit?: number;
|
|
80
|
+
}) => RunnableEffect<{
|
|
81
|
+
readonly count: number;
|
|
82
|
+
readonly deleted: ReadonlyArray<T>;
|
|
83
|
+
readonly cascaded?: Record<string, {
|
|
84
|
+
readonly count: number;
|
|
85
|
+
readonly ids: ReadonlyArray<string>;
|
|
86
|
+
}>;
|
|
87
|
+
}, ValidationError | OperationError>;
|
|
88
|
+
readonly aggregate: <C extends AggregateConfig>(config: C) => C extends {
|
|
89
|
+
readonly groupBy: string | ReadonlyArray<string>;
|
|
90
|
+
} ? RunnableEffect<GroupedAggregateResult, never> : RunnableEffect<AggregateResult, never>;
|
|
91
|
+
/**
|
|
92
|
+
* Create a reactive subscription that emits query results whenever the collection changes.
|
|
93
|
+
*
|
|
94
|
+
* The stream:
|
|
95
|
+
* 1. Emits the current result set immediately upon subscription
|
|
96
|
+
* 2. Re-emits whenever the underlying data changes (create/update/delete/reload)
|
|
97
|
+
* 3. Deduplicates consecutive identical result sets to avoid spurious emissions
|
|
98
|
+
*
|
|
99
|
+
* The stream is scoped: it subscribes to change notifications on creation and
|
|
100
|
+
* automatically unsubscribes when the scope closes or the stream is interrupted.
|
|
101
|
+
*
|
|
102
|
+
* @param config - Optional query configuration (where, sort, select, limit, offset, debounceMs)
|
|
103
|
+
* @returns A scoped Effect that produces a Stream of result arrays
|
|
104
|
+
*/
|
|
105
|
+
readonly watch: (config?: {
|
|
106
|
+
readonly where?: Record<string, unknown>;
|
|
107
|
+
readonly sort?: Record<string, "asc" | "desc">;
|
|
108
|
+
readonly select?: Record<string, unknown> | ReadonlyArray<string>;
|
|
109
|
+
readonly limit?: number;
|
|
110
|
+
readonly offset?: number;
|
|
111
|
+
readonly debounceMs?: number;
|
|
112
|
+
}) => Effect.Effect<Stream.Stream<ReadonlyArray<T>>, never, Scope.Scope>;
|
|
113
|
+
/**
|
|
114
|
+
* Create a reactive subscription for a single entity by ID.
|
|
115
|
+
*
|
|
116
|
+
* Emits the entity immediately if it exists (or null if not), then re-emits
|
|
117
|
+
* whenever the entity is created, updated, or deleted.
|
|
118
|
+
*
|
|
119
|
+
* The stream is scoped: it subscribes to change notifications on creation and
|
|
120
|
+
* automatically unsubscribes when the scope closes or the stream is interrupted.
|
|
121
|
+
*
|
|
122
|
+
* @param id - The entity ID to watch
|
|
123
|
+
* @returns A scoped Effect that produces a Stream of T | null
|
|
124
|
+
*/
|
|
125
|
+
readonly watchById: (id: string) => Effect.Effect<Stream.Stream<T | null>, never, Scope.Scope>;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Database type: a record of collection names to EffectCollections,
|
|
129
|
+
* plus the $transaction method for atomic operations.
|
|
130
|
+
*/
|
|
131
|
+
export type EffectDatabase<Config extends DatabaseConfig> = {
|
|
132
|
+
readonly [K in keyof Config]: EffectCollection<Schema.Schema.Type<Config[K]["schema"]> & HasId>;
|
|
133
|
+
} & {
|
|
134
|
+
/**
|
|
135
|
+
* Execute multiple operations atomically within a transaction.
|
|
136
|
+
* On success, all changes are committed and persistence is triggered.
|
|
137
|
+
* On failure, all changes are rolled back and the original error is re-raised.
|
|
138
|
+
*/
|
|
139
|
+
readonly $transaction: <A, E>(fn: (ctx: TransactionContext) => Effect.Effect<A, E>) => RunnableEffect<A, E | TransactionError>;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Configuration for database persistence.
|
|
143
|
+
* When provided, CRUD mutations trigger debounced saves to disk.
|
|
144
|
+
*/
|
|
145
|
+
export interface EffectDatabasePersistenceConfig {
|
|
146
|
+
/** Debounce delay in milliseconds (default 100) */
|
|
147
|
+
readonly writeDebounce?: number;
|
|
148
|
+
/**
|
|
149
|
+
* Plugin codecs to merge with the serializer registry.
|
|
150
|
+
* When provided, these codecs are layered on top of the user-provided
|
|
151
|
+
* SerializerRegistry service, with plugin codecs taking precedence.
|
|
152
|
+
* @internal Used by plugin system integration
|
|
153
|
+
*/
|
|
154
|
+
readonly _pluginCodecs?: ReadonlyArray<FormatCodec>;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Extended database type with persistence control methods.
|
|
158
|
+
*/
|
|
159
|
+
export type EffectDatabaseWithPersistence<Config extends DatabaseConfig> = EffectDatabase<Config> & {
|
|
160
|
+
/** Flush all pending debounced writes immediately. Returns a Promise. */
|
|
161
|
+
readonly flush: () => Promise<void>;
|
|
162
|
+
/** Returns the number of writes currently pending. */
|
|
163
|
+
readonly pendingCount: () => number;
|
|
164
|
+
/**
|
|
165
|
+
* Preview which files need migration and what transforms would apply.
|
|
166
|
+
* No transforms are executed. No files are written.
|
|
167
|
+
*/
|
|
168
|
+
readonly $dryRunMigrations: () => RunnableEffect<DryRunResult, MigrationError | StorageError | SerializationError | UnsupportedFormatError>;
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* Options for creating an Effect-based database.
|
|
172
|
+
*/
|
|
173
|
+
export interface EffectDatabaseOptions {
|
|
174
|
+
/** Plugins to load, providing custom codecs, operators, ID generators, and global hooks */
|
|
175
|
+
readonly plugins?: ReadonlyArray<ProseQLPlugin>;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Create an Effect-based in-memory database.
|
|
179
|
+
*
|
|
180
|
+
* Accepts a DatabaseConfig and optional initial data (arrays keyed by collection name).
|
|
181
|
+
* Returns an Effect that initializes Ref state for each collection and wires up
|
|
182
|
+
* the query pipeline and CRUD methods.
|
|
183
|
+
*
|
|
184
|
+
* Optionally accepts plugins that provide custom codecs, operators, ID generators,
|
|
185
|
+
* and global lifecycle hooks.
|
|
186
|
+
*
|
|
187
|
+
* Usage:
|
|
188
|
+
* ```ts
|
|
189
|
+
* const db = yield* createEffectDatabase(config, {
|
|
190
|
+
* users: [{ id: "1", name: "Alice", age: 30 }],
|
|
191
|
+
* companies: [{ id: "c1", name: "TechCorp" }],
|
|
192
|
+
* })
|
|
193
|
+
*
|
|
194
|
+
* // Query
|
|
195
|
+
* const results = yield* Stream.runCollect(db.users.query({ where: { age: { $gt: 18 } } }))
|
|
196
|
+
*
|
|
197
|
+
* // CRUD
|
|
198
|
+
* const user = yield* db.users.create({ name: "Bob", age: 25 })
|
|
199
|
+
* ```
|
|
200
|
+
*
|
|
201
|
+
* With plugins:
|
|
202
|
+
* ```ts
|
|
203
|
+
* const db = yield* createEffectDatabase(config, initialData, {
|
|
204
|
+
* plugins: [regexPlugin, snowflakeIdPlugin]
|
|
205
|
+
* })
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
export declare const createEffectDatabase: <Config extends DatabaseConfig>(config: Config, initialData?: { readonly [K in keyof Config]?: ReadonlyArray<Record<string, unknown>>; }, options?: EffectDatabaseOptions) => Effect.Effect<GenerateDatabase<Config>, MigrationError | PluginError>;
|
|
209
|
+
/**
|
|
210
|
+
* Create an Effect-based in-memory database with persistence.
|
|
211
|
+
*
|
|
212
|
+
* Like `createEffectDatabase`, but additionally wires debounced persistence hooks
|
|
213
|
+
* so that each CRUD mutation triggers a fire-and-forget save to disk.
|
|
214
|
+
*
|
|
215
|
+
* Collections with a `file` field in their config are persisted. Collections
|
|
216
|
+
* without a `file` are in-memory only.
|
|
217
|
+
*
|
|
218
|
+
* Requires `StorageAdapter` and `SerializerRegistry` services in the environment.
|
|
219
|
+
*
|
|
220
|
+
* Optionally accepts plugins that provide custom codecs, operators, ID generators,
|
|
221
|
+
* and global lifecycle hooks.
|
|
222
|
+
*
|
|
223
|
+
* Usage:
|
|
224
|
+
* ```ts
|
|
225
|
+
* const db = yield* createPersistentEffectDatabase(config, initialData, { writeDebounce: 200 })
|
|
226
|
+
* // CRUD mutations now trigger debounced saves
|
|
227
|
+
* yield* db.users.create({ name: "Alice", age: 30 })
|
|
228
|
+
* // Flush all pending writes before shutdown
|
|
229
|
+
* yield* db.flush()
|
|
230
|
+
* ```
|
|
231
|
+
*
|
|
232
|
+
* With plugins:
|
|
233
|
+
* ```ts
|
|
234
|
+
* const db = yield* createPersistentEffectDatabase(config, initialData, persistenceConfig, {
|
|
235
|
+
* plugins: [regexPlugin, snowflakeIdPlugin]
|
|
236
|
+
* })
|
|
237
|
+
* ```
|
|
238
|
+
*/
|
|
239
|
+
export declare const createPersistentEffectDatabase: <Config extends DatabaseConfig>(config: Config, initialData?: { readonly [K in keyof Config]?: ReadonlyArray<Record<string, unknown>>; }, persistenceConfig?: EffectDatabasePersistenceConfig, options?: EffectDatabaseOptions) => Effect.Effect<GenerateDatabaseWithPersistence<Config>, MigrationError | StorageError | SerializationError | UnsupportedFormatError | ValidationError | PluginError, StorageAdapter | SerializerRegistry | Scope.Scope>;
|
|
240
|
+
export {};
|
|
241
|
+
//# sourceMappingURL=database-effect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database-effect.d.ts","sourceRoot":"","sources":["../../src/factories/database-effect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EA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