@typesql/pg 0.3.2 → 0.4.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/dist/index.d.ts CHANGED
@@ -1,14 +1,9 @@
1
- import type { RowKeys } from "@typesql/core";
1
+ import type { SqlPlugin } from "@typesql/core";
2
2
  import { type TransactionalSql } from "@typesql/core/postgres";
3
3
  import { type PgQueryable } from "./client.js";
4
4
  import type { PgTypeMap } from "./type-map.js";
5
5
  export { executor, type MigrationSource, migrate, type PgPoolLike, type PgQueryable, type PgQueryConfig, type PgResult, type PgTransactionClient, } from "./client.js";
6
6
  export type { PgInterval, PgParamTypeMap, PgTypeMap } from "./type-map.js";
7
- export type PgSql<DB, Keys extends RowKeys = "preserve"> = TransactionalSql<DB, PgTypeMap, Keys>;
8
- export declare function createSql<DB>(client: PgQueryable | undefined, options: {
9
- readonly rowKeys: "camelCase";
10
- }): PgSql<DB, "camelCase">;
11
- export declare function createSql<DB>(client?: PgQueryable, options?: {
12
- readonly rowKeys?: "preserve";
13
- }): PgSql<DB>;
7
+ export type PgSql<DB, Plugins extends readonly SqlPlugin[] = []> = TransactionalSql<DB, PgTypeMap, Plugins>;
8
+ export declare function createSql<DB>(client?: PgQueryable): PgSql<DB>;
14
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAc,MAAM,eAAe,CAAC;AAEzD,OAAO,EAGN,KAAK,gBAAgB,EACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EACN,QAAQ,EACR,KAAK,eAAe,EACpB,OAAO,EACP,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,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,GAAG,EAAE,IACtC,gBAAgB,CAAC,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AAE7C,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC,EAAE,CAAC,CAM7D"}
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { createTransactionalSql } from "@typesql/core/adapter";
2
2
  import { postgres, } from "@typesql/core/postgres";
3
3
  import { driver } from "./client.js";
4
4
  export { executor, migrate, } from "./client.js";
5
- export function createSql(client, options) {
6
- return createTransactionalSql(postgres, client, driver, options);
5
+ export function createSql(client) {
6
+ return createTransactionalSql(postgres, client, driver);
7
7
  }
8
8
  //# 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":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAEN,QAAQ,GAER,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,MAAM,EAAoB,MAAM,aAAa,CAAC;AAGvD,OAAO,EACN,QAAQ,EAER,OAAO,GAMP,MAAM,aAAa,CAAC;AAiBrB,MAAM,UAAU,SAAS,CACxB,MAAoB,EACpB,OAAoB;IAEpB,OAAO,sBAAsB,CAC5B,QAAQ,EACR,MAAM,EACN,MAAM,EACN,OAAO,CACP,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAEN,QAAQ,GAER,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,MAAM,EAAoB,MAAM,aAAa,CAAC;AAGvD,OAAO,EACN,QAAQ,EAER,OAAO,GAMP,MAAM,aAAa,CAAC;AAQrB,MAAM,UAAU,SAAS,CAAK,MAAoB;IACjD,OAAO,sBAAsB,CAC5B,QAAQ,EACR,MAAM,EACN,MAAM,CACN,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typesql/pg",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "description": "node-postgres (pg) adapter for TypeSQL, with the introspection behind `typesql introspect` (@typesql/cli).",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -32,7 +32,7 @@
32
32
  "access": "public"
33
33
  },
34
34
  "dependencies": {
35
- "@typesql/core": "0.9.1"
35
+ "@typesql/core": "0.10.0"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "pg": ">=8"
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { RowKeys, SqlOptions } from "@typesql/core";
1
+ import type { SqlPlugin } from "@typesql/core";
2
2
  import { createTransactionalSql } from "@typesql/core/adapter";
3
3
  import {
4
4
  type Postgres,
@@ -20,28 +20,15 @@ export {
20
20
  } from "./client.js";
21
21
  export type { PgInterval, PgParamTypeMap, PgTypeMap } from "./type-map.js";
22
22
 
23
- export type PgSql<DB, Keys extends RowKeys = "preserve"> = TransactionalSql<
23
+ export type PgSql<
24
24
  DB,
25
- PgTypeMap,
26
- Keys
27
- >;
25
+ Plugins extends readonly SqlPlugin[] = [],
26
+ > = TransactionalSql<DB, PgTypeMap, Plugins>;
28
27
 
29
- export function createSql<DB>(
30
- client: PgQueryable | undefined,
31
- options: { readonly rowKeys: "camelCase" },
32
- ): PgSql<DB, "camelCase">;
33
- export function createSql<DB>(
34
- client?: PgQueryable,
35
- options?: { readonly rowKeys?: "preserve" },
36
- ): PgSql<DB>;
37
- export function createSql<DB>(
38
- client?: PgQueryable,
39
- options?: SqlOptions,
40
- ): PgSql<DB, RowKeys> {
28
+ export function createSql<DB>(client?: PgQueryable): PgSql<DB> {
41
29
  return createTransactionalSql<Postgres, DB, PgTypeMap, PgQueryable>(
42
30
  postgres,
43
31
  client,
44
32
  driver,
45
- options,
46
33
  );
47
34
  }