@ontrails/drizzle 1.0.0-beta.15

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.
@@ -0,0 +1 @@
1
+ $ tsc -b
@@ -0,0 +1,3 @@
1
+ $ oxlint ./src
2
+ Found 0 warnings and 0 errors.
3
+ Finished in 62ms on 5 files with 93 rules using 24 threads.
@@ -0,0 +1 @@
1
+ $ tsc --noEmit
package/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ # @ontrails/drizzle
2
+
3
+ ## 1.0.0-beta.15
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [4ad6b25]
8
+ - @ontrails/core@1.0.0-beta.15
9
+ - @ontrails/store@1.0.0-beta.15
package/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # @ontrails/drizzle
2
+
3
+ Drizzle connector for Trails stores. Use this package to bind a connector-agnostic `store(...)` definition from `@ontrails/store` to a concrete Drizzle runtime.
4
+
5
+ ## Usage
6
+
7
+ ```typescript
8
+ import { store } from '@ontrails/store';
9
+ import { connectDrizzle } from '@ontrails/drizzle';
10
+
11
+ const definition = store({
12
+ gists: {
13
+ schema: gistSchema,
14
+ primaryKey: 'id',
15
+ generated: ['id', 'createdAt', 'updatedAt'],
16
+ },
17
+ });
18
+
19
+ export const db = connectDrizzle(definition, {
20
+ id: 'db.main',
21
+ url: ':memory:',
22
+ });
23
+ ```
24
+
25
+ ## Installation
26
+
27
+ ```bash
28
+ bun add @ontrails/store @ontrails/drizzle zod
29
+ ```
30
+
31
+ ## Migration
32
+
33
+ This package replaces the old `@ontrails/store/drizzle` subpath.
34
+
35
+ - Before: `import { connectDrizzle } from '@ontrails/store/drizzle'`
36
+ - After: `import { connectDrizzle } from '@ontrails/drizzle'`
@@ -0,0 +1,3 @@
1
+ export { connectDrizzle, connectReadOnlyDrizzle } from './runtime.js';
2
+ export type { DrizzleQueryContext, DrizzleStoreConnection, DrizzleStoreOptions, DrizzleStoreResource, DrizzleStoreSchema, ReadOnlyDrizzleStoreConnection, } from './types.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtE,YAAY,EACV,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,8BAA8B,GAC/B,MAAM,YAAY,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { connectDrizzle, connectReadOnlyDrizzle } from './runtime.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { AnyStoreDefinition } from '@ontrails/store';
2
+ import type { DrizzleStoreConnection, DrizzleStoreOptions, DrizzleStoreResource, ReadOnlyDrizzleStoreConnection } from './types.js';
3
+ /**
4
+ * Bind a store definition to a Drizzle-backed SQLite resource.
5
+ *
6
+ * The returned resource manages its own connection lifecycle. The `mock()`
7
+ * factory creates an in-memory SQLite database seeded with fixtures — callers
8
+ * who obtain a mock connection are responsible for calling `closeConnection()`
9
+ * when done, or letting the connection be garbage-collected (the underlying
10
+ * `Database` client is tracked via `WeakMap`).
11
+ *
12
+ * Note: the `search` field on `StoreTableInput` is not yet interpreted by
13
+ * this connector — it is reserved for future full-text search support.
14
+ */
15
+ export declare const connectDrizzle: <const TStore extends AnyStoreDefinition>(definition: TStore, options: DrizzleStoreOptions<TStore>) => DrizzleStoreResource<TStore, DrizzleStoreConnection<TStore>, "readwrite">;
16
+ export declare const connectReadOnlyDrizzle: <const TStore extends AnyStoreDefinition>(definition: TStore, options: DrizzleStoreOptions<TStore>) => DrizzleStoreResource<TStore, ReadOnlyDrizzleStoreConnection<TStore>, "readonly">;
17
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACV,kBAAkB,EAcnB,MAAM,iBAAiB,CAAC;AAYzB,OAAO,KAAK,EACV,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EAEpB,8BAA8B,EAC/B,MAAM,YAAY,CAAC;AA+pCpB;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc,GAAI,KAAK,CAAC,MAAM,SAAS,kBAAkB,EACpE,YAAY,MAAM,EAClB,SAAS,mBAAmB,CAAC,MAAM,CAAC,KACnC,oBAAoB,CACrB,MAAM,EACN,sBAAsB,CAAC,MAAM,CAAC,EAC9B,WAAW,CAqDZ,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,KAAK,CAAC,MAAM,SAAS,kBAAkB,EAC5E,YAAY,MAAM,EAClB,SAAS,mBAAmB,CAAC,MAAM,CAAC,KACnC,oBAAoB,CACrB,MAAM,EACN,8BAA8B,CAAC,MAAM,CAAC,EACtC,UAAU,CAoCX,CAAC"}