@slonik/types 46.1.0 → 46.3.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/types.d.ts CHANGED
@@ -1,12 +1,3 @@
1
- export type PrimitiveValueExpression = Buffer | bigint | boolean | number | string | readonly PrimitiveValueExpression[] | null;
2
- export type Query = {
3
- readonly sql: string;
4
- readonly values: readonly PrimitiveValueExpression[];
5
- };
6
- export type QueryResultRow = Record<string, PrimitiveValueExpression>;
7
- export type SerializableValue = SerializableValue[] | boolean | number | string | readonly SerializableValue[] | {
8
- [key: string]: SerializableValue;
9
- } | null | undefined;
10
1
  /**
11
2
  * @see https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS
12
3
  */
@@ -17,6 +8,12 @@ export type ConnectionOptions = {
17
8
  options?: string;
18
9
  password?: string;
19
10
  port?: number;
11
+ ssl?: {
12
+ ca?: string;
13
+ cert?: string;
14
+ key?: string;
15
+ rejectUnauthorized: boolean;
16
+ };
20
17
  sslMode?: 'disable' | 'no-verify' | 'require';
21
18
  username?: string;
22
19
  };
@@ -24,4 +21,13 @@ export type Field = {
24
21
  readonly dataTypeId: number;
25
22
  readonly name: string;
26
23
  };
24
+ export type PrimitiveValueExpression = bigint | boolean | Buffer | null | number | readonly PrimitiveValueExpression[] | string;
25
+ export type Query = {
26
+ readonly sql: string;
27
+ readonly values: readonly PrimitiveValueExpression[];
28
+ };
29
+ export type QueryResultRow = Record<string, PrimitiveValueExpression>;
30
+ export type SerializableValue = boolean | null | number | readonly SerializableValue[] | SerializableValue[] | string | undefined | {
31
+ [key: string]: SerializableValue;
32
+ };
27
33
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,wBAAwB,GAChC,MAAM,GACN,MAAM,GACN,OAAO,GACP,MAAM,GACN,MAAM,GACN,SAAS,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AAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE;QACJ,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,kBAAkB,EAAE,OAAO,CAAC;KAC7B,CAAC;IACF,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IAClB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAChC,MAAM,GACN,OAAO,GACP,MAAM,GACN,IAAI,GACJ,MAAM,GACN,SAAS,wBAAwB,EAAE,GACnC,MAAM,CAAC;AAEX,MAAM,MAAM,KAAK,GAAG;IAClB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,SAAS,wBAAwB,EAAE,CAAC;CACtD,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;AAEtE,MAAM,MAAM,iBAAiB,GACzB,OAAO,GACP,IAAI,GACJ,MAAM,GACN,SAAS,iBAAiB,EAAE,GAC5B,iBAAiB,EAAE,GACnB,MAAM,GACN,SAAS,GACT;IACE,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAAC;CAClC,CAAC"}
package/package.json CHANGED
@@ -17,14 +17,14 @@
17
17
  },
18
18
  "description": "A Node.js PostgreSQL client with strict types, detailed logging and assertions.",
19
19
  "devDependencies": {
20
- "@types/node": "^18.15.3",
20
+ "@types/node": "^22.9.0",
21
21
  "ava": "^6.1.3",
22
- "cspell": "^8.6.0",
23
- "eslint": "^8.57.0",
24
- "eslint-config-canonical": "^42.8.1",
22
+ "cspell": "^8.16.0",
23
+ "eslint": "^9.16.0",
25
24
  "nyc": "^15.1.0",
26
25
  "ts-node": "^10.9.1",
27
- "typescript": "^5.4.5"
26
+ "typescript": "^5.6.3",
27
+ "@slonik/eslint-config": "^46.3.0"
28
28
  },
29
29
  "engines": {
30
30
  "node": ">=18"
@@ -67,7 +67,7 @@
67
67
  "url": "https://github.com/gajus/slonik"
68
68
  },
69
69
  "types": "./dist/index.d.ts",
70
- "version": "46.1.0",
70
+ "version": "46.3.0",
71
71
  "scripts": {
72
72
  "build": "rm -fr ./dist && tsc --project ./tsconfig.json",
73
73
  "lint": "npm run lint:cspell && npm run lint:eslint && npm run lint:tsc",
package/src/types.ts CHANGED
@@ -1,11 +1,36 @@
1
+ /**
2
+ * @see https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS
3
+ */
4
+ export type ConnectionOptions = {
5
+ applicationName?: string;
6
+ databaseName?: string;
7
+ host?: string;
8
+ options?: string;
9
+ password?: string;
10
+ port?: number;
11
+ ssl?: {
12
+ ca?: string;
13
+ cert?: string;
14
+ key?: string;
15
+ rejectUnauthorized: boolean;
16
+ };
17
+ sslMode?: 'disable' | 'no-verify' | 'require';
18
+ username?: string;
19
+ };
20
+
21
+ export type Field = {
22
+ readonly dataTypeId: number;
23
+ readonly name: string;
24
+ };
25
+
1
26
  export type PrimitiveValueExpression =
2
- | Buffer
3
27
  | bigint
4
28
  | boolean
29
+ | Buffer
30
+ | null
5
31
  | number
6
- | string
7
32
  | readonly PrimitiveValueExpression[]
8
- | null;
33
+ | string;
9
34
 
10
35
  export type Query = {
11
36
  readonly sql: string;
@@ -15,32 +40,13 @@ export type Query = {
15
40
  export type QueryResultRow = Record<string, PrimitiveValueExpression>;
16
41
 
17
42
  export type SerializableValue =
18
- | SerializableValue[]
19
43
  | boolean
44
+ | null
20
45
  | number
21
- | string
22
46
  | readonly SerializableValue[]
47
+ | SerializableValue[]
48
+ | string
49
+ | undefined
23
50
  | {
24
51
  [key: string]: SerializableValue;
25
- }
26
- | null
27
- | undefined;
28
-
29
- /**
30
- * @see https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS
31
- */
32
- export type ConnectionOptions = {
33
- applicationName?: string;
34
- databaseName?: string;
35
- host?: string;
36
- options?: string;
37
- password?: string;
38
- port?: number;
39
- sslMode?: 'disable' | 'no-verify' | 'require';
40
- username?: string;
41
- };
42
-
43
- export type Field = {
44
- readonly dataTypeId: number;
45
- readonly name: string;
46
- };
52
+ };