@typesql/drizzle 0.0.1 → 0.0.3

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 ADDED
@@ -0,0 +1,8 @@
1
+ # @typesql/drizzle
2
+
3
+ ## 0.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies:
8
+ - @typesql/core@0.0.3
package/dist/index.d.ts CHANGED
@@ -1,11 +1,14 @@
1
- import { type DefaultTypeMap, type Sql } from "@typesql/core";
1
+ import { type DefaultTypeMap, type Executor, type Sql } from "@typesql/core";
2
2
  import type { FromDrizzle, FromDrizzleOptions } from "./from-drizzle.js";
3
3
  export type { FromDrizzle, FromDrizzleOptions, DrizzleColumnTypes } from "./from-drizzle.js";
4
4
  export { pgType } from "./pg-type.js";
5
- export type { Sql, Query, RowType, ParamsType, DefaultTypeMap, TypeMap } from "@typesql/core";
5
+ export type { Sql, Query, RowType, ParamsType, DefaultTypeMap, TypeMap, Executor } from "@typesql/core";
6
+ export { NoResultError } from "@typesql/core";
6
7
  /**
7
8
  * `createSql` from core with the schema converted from Drizzle definitions:
8
9
  * `createSql<typeof schema>()`, or `createSql<typeof schema, PgTypeMap>()` for a driver's type map.
10
+ * With an `executor` from a driver adapter (`executor(pool)` from `@typesql/pg`), the queries'
11
+ * `execute*` methods run on it.
9
12
  */
10
- export declare function createSql<Schema, TM = DefaultTypeMap, Opts extends FromDrizzleOptions = {}>(): Sql<FromDrizzle<Schema, Opts>, TM>;
13
+ export declare function createSql<Schema, TM = DefaultTypeMap, Opts extends FromDrizzleOptions = {}>(executor?: Executor): Sql<FromDrizzle<Schema, Opts>, TM>;
11
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,KAAK,cAAc,EAAE,KAAK,GAAG,EAAE,MAAM,eAAe,CAAC;AAC1F,OAA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AC,CAEpJ"}
package/dist/index.js CHANGED
@@ -1,10 +1,13 @@
1
1
  import { createSql as createCoreSql } from "@typesql/core";
2
2
  export { pgType } from "./pg-type.js";
3
+ export { NoResultError } from "@typesql/core";
3
4
  /**
4
5
  * `createSql` from core with the schema converted from Drizzle definitions:
5
6
  * `createSql<typeof schema>()`, or `createSql<typeof schema, PgTypeMap>()` for a driver's type map.
7
+ * With an `executor` from a driver adapter (`executor(pool)` from `@typesql/pg`), the queries'
8
+ * `execute*` methods run on it.
6
9
  */
7
- export function createSql() {
8
- return createCoreSql();
10
+ export function createSql(executor) {
11
+ return createCoreSql(executor);
9
12
  }
10
13
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,aAAa,EAAiC,MAAM,eAAe,CAAC;AAI1F,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGtC;;;GAGG;AACH,MAAM,UAAU,SAAS;IACvB,OAAO,aAAa,EAAiC,CAAC;AACxD,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,aAAa,EAAgD,MAAM,eAAe,CAAC;AAIzG,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAoE,QAAmB;IAC9G,OAAO,aAAa,CAAgC,QAAQ,CAAC,CAAC;AAChE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typesql/drizzle",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "Use Drizzle ORM table definitions as a typesql schema.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -28,13 +28,13 @@
28
28
  "access": "public"
29
29
  },
30
30
  "dependencies": {
31
- "@typesql/core": "0.0.1"
31
+ "@typesql/core": "0.0.3"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "drizzle-orm": ">=0.45"
35
35
  },
36
36
  "devDependencies": {
37
- "@typesql/pg": "0.0.1",
37
+ "@typesql/pg": "0.0.3",
38
38
  "drizzle-orm": "^0.45.4",
39
39
  "typescript": "7.0.2",
40
40
  "vitest": "^5.0.4"
package/src/index.ts CHANGED
@@ -1,14 +1,17 @@
1
- import { createSql as createCoreSql, type DefaultTypeMap, type Sql } from "@typesql/core";
1
+ import { createSql as createCoreSql, type DefaultTypeMap, type Executor, type Sql } from "@typesql/core";
2
2
  import type { FromDrizzle, FromDrizzleOptions } from "./from-drizzle.js";
3
3
 
4
4
  export type { FromDrizzle, FromDrizzleOptions, DrizzleColumnTypes } from "./from-drizzle.js";
5
5
  export { pgType } from "./pg-type.js";
6
- export type { Sql, Query, RowType, ParamsType, DefaultTypeMap, TypeMap } from "@typesql/core";
6
+ export type { Sql, Query, RowType, ParamsType, DefaultTypeMap, TypeMap, Executor } from "@typesql/core";
7
+ export { NoResultError } from "@typesql/core";
7
8
 
8
9
  /**
9
10
  * `createSql` from core with the schema converted from Drizzle definitions:
10
11
  * `createSql<typeof schema>()`, or `createSql<typeof schema, PgTypeMap>()` for a driver's type map.
12
+ * With an `executor` from a driver adapter (`executor(pool)` from `@typesql/pg`), the queries'
13
+ * `execute*` methods run on it.
11
14
  */
12
- export function createSql<Schema, TM = DefaultTypeMap, Opts extends FromDrizzleOptions = {}>(): Sql<FromDrizzle<Schema, Opts>, TM> {
13
- return createCoreSql<FromDrizzle<Schema, Opts>, TM>();
15
+ export function createSql<Schema, TM = DefaultTypeMap, Opts extends FromDrizzleOptions = {}>(executor?: Executor): Sql<FromDrizzle<Schema, Opts>, TM> {
16
+ return createCoreSql<FromDrizzle<Schema, Opts>, TM>(executor);
14
17
  }