@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 +3 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +5 -18
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import type {
|
|
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,
|
|
8
|
-
export declare function createSql<DB>(client
|
|
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
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C,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,KAAK,QAAQ,EACb,KAAK,mBAAmB,GACxB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE3E,MAAM,MAAM,KAAK,CAChB,EAAE,EACF,OAAO,SAAS,SAAS,SAAS,EAAE,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
|
|
6
|
-
return createTransactionalSql(postgres, client, driver
|
|
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;
|
|
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
|
+
"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.
|
|
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 {
|
|
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<
|
|
23
|
+
export type PgSql<
|
|
24
24
|
DB,
|
|
25
|
-
|
|
26
|
-
|
|
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
|
}
|