@runlot/pg 0.1.0-rc.17 → 0.1.0-rc.170
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/README.md +12 -12
- package/dist/bundler.d.ts +30 -9
- package/dist/bundler.d.ts.map +1 -1
- package/dist/bundler.js +149 -57
- package/dist/bundler.js.map +1 -1
- package/dist/client.d.ts +34 -14
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +173 -33
- package/dist/client.js.map +1 -1
- package/dist/emitter.d.ts.map +1 -1
- package/dist/emitter.js +6 -5
- package/dist/emitter.js.map +1 -1
- package/dist/errors.d.ts +8 -6
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +10 -7
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/orm/drizzle.d.ts.map +1 -1
- package/dist/orm/drizzle.js +5 -4
- package/dist/orm/drizzle.js.map +1 -1
- package/dist/orm/knex.d.ts.map +1 -1
- package/dist/orm/knex.js +7 -8
- package/dist/orm/knex.js.map +1 -1
- package/dist/orm/kysely.js +3 -3
- package/dist/orm/kysely.js.map +1 -1
- package/dist/orm/prisma.d.ts.map +1 -1
- package/dist/orm/prisma.js +16 -12
- package/dist/orm/prisma.js.map +1 -1
- package/dist/orm/sequelize.d.ts.map +1 -1
- package/dist/orm/sequelize.js +9 -6
- package/dist/orm/sequelize.js.map +1 -1
- package/dist/orm/typeorm.d.ts.map +1 -1
- package/dist/orm/typeorm.js +6 -5
- package/dist/orm/typeorm.js.map +1 -1
- package/dist/type-parsers.d.ts +14 -10
- package/dist/type-parsers.d.ts.map +1 -1
- package/dist/type-parsers.js +41 -31
- package/dist/type-parsers.js.map +1 -1
- package/dist/types.d.ts +26 -10
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +6 -4
- package/dist/types.js.map +1 -1
- package/package.json +9 -4
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
/** `tryExec`
|
|
1
|
+
/** The error `tryExec` answers with as a value. The SQLSTATE is read from
|
|
2
|
+
* `code` and nowhere else. */
|
|
2
3
|
export interface DbErrorData {
|
|
3
4
|
code: string;
|
|
4
5
|
message: string;
|
|
@@ -14,7 +15,8 @@ export interface DbColumn {
|
|
|
14
15
|
export type TryExecResult = {
|
|
15
16
|
ok: true;
|
|
16
17
|
columns: DbColumn[];
|
|
17
|
-
/**
|
|
18
|
+
/** Positional arrays. No cell is lost even when column names
|
|
19
|
+
* collide. */
|
|
18
20
|
values: unknown[][];
|
|
19
21
|
rows: Record<string, unknown>[];
|
|
20
22
|
commandTag: string | null;
|
|
@@ -24,13 +26,16 @@ export type TryExecResult = {
|
|
|
24
26
|
error: DbErrorData;
|
|
25
27
|
transactionStatus?: string | null;
|
|
26
28
|
};
|
|
27
|
-
/**
|
|
29
|
+
/** A request-scoped session handle (`env.db.session()`). Transactions,
|
|
30
|
+
* prepared statements and SET are kept inside it. */
|
|
28
31
|
export interface DbSession {
|
|
29
32
|
exec(sql: string, params?: unknown[]): Promise<unknown[]>;
|
|
30
33
|
tryExec(sql: string, params?: unknown[]): Promise<TryExecResult>;
|
|
31
34
|
close(): Promise<void>;
|
|
32
35
|
}
|
|
33
|
-
/**
|
|
36
|
+
/** What the user worker sees as `env.db`. With automatic RLS on, the identity
|
|
37
|
+
* comes from how the code was entered (docs/app-auth-rls.md); `session()`
|
|
38
|
+
* takes no options. */
|
|
34
39
|
export interface Db {
|
|
35
40
|
exec(sql: string, params?: unknown[]): Promise<unknown[]>;
|
|
36
41
|
tryExec(sql: string, params?: unknown[]): Promise<TryExecResult>;
|
|
@@ -45,35 +50,46 @@ export interface StorageObject {
|
|
|
45
50
|
size: number;
|
|
46
51
|
etag: string;
|
|
47
52
|
contentType: string;
|
|
48
|
-
/** RFC 1123 (Last-Modified
|
|
53
|
+
/** RFC 1123 (exactly the Last-Modified header). It can be empty. */
|
|
49
54
|
lastModified: string;
|
|
50
55
|
}
|
|
51
56
|
export interface StorageListPage {
|
|
52
57
|
objects: StorageObject[];
|
|
53
|
-
/**
|
|
58
|
+
/** Empty means it is the last page. Pass it as the `cursor` of the next
|
|
59
|
+
* call. */
|
|
54
60
|
cursor: string;
|
|
55
61
|
}
|
|
56
|
-
/**
|
|
62
|
+
/** What the user worker sees as `env.storage`. A key is a path relative to the
|
|
63
|
+
* project prefix. */
|
|
57
64
|
export interface Storage {
|
|
58
65
|
put(key: string, body: BodyInit | null, opts?: {
|
|
59
66
|
contentType?: string;
|
|
60
67
|
}): Promise<StorageObject>;
|
|
61
|
-
/**
|
|
68
|
+
/** `null` when it is not there. A 404 is not an exception. */
|
|
62
69
|
get(key: string): Promise<(StorageObject & {
|
|
63
70
|
body: ReadableStream<Uint8Array> | null;
|
|
64
71
|
}) | null>;
|
|
65
72
|
head(key: string): Promise<StorageObject | null>;
|
|
66
|
-
/**
|
|
73
|
+
/** Idempotent. Deleting a key that does not exist is a success. */
|
|
67
74
|
delete(key: string): Promise<void>;
|
|
68
75
|
list(opts?: {
|
|
69
76
|
prefix?: string;
|
|
70
77
|
cursor?: string;
|
|
71
78
|
limit?: number;
|
|
72
79
|
}): Promise<StorageListPage>;
|
|
73
|
-
/**
|
|
80
|
+
/**
|
|
81
|
+
* A signed URL. GET and PUT only. ttl is in seconds (default 300, ceiling
|
|
82
|
+
* 3600).
|
|
83
|
+
*
|
|
84
|
+
* Passing `size` binds that byte count into the signature — uploading a
|
|
85
|
+
* different length gets refused by the store with a 403, and the quota is
|
|
86
|
+
* checked against that size at issue time. Without it there is no ceiling on
|
|
87
|
+
* how much this URL can upload. Used on PUT only.
|
|
88
|
+
*/
|
|
74
89
|
presign(key: string, opts?: {
|
|
75
90
|
method?: "GET" | "PUT";
|
|
76
91
|
ttl?: number;
|
|
92
|
+
size?: number;
|
|
77
93
|
}): Promise<string>;
|
|
78
94
|
}
|
|
79
95
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAQA;+BAC+B;AAC/B,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,aAAa,GACrB;IACE,EAAE,EAAE,IAAI,CAAC;IACT,OAAO,EAAE,QAAQ,EAAE,CAAC;IACpB;mBACe;IACf,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAChC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC,GACD;IACE,EAAE,EAAE,KAAK,CAAC;IACV,KAAK,EAAE,WAAW,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC,CAAC;AAEN;sDACsD;AACtD,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAC1D,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACjE,KAAK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G,IAAI,CAAC,CAAC;IACjD,mEAAmE;IACnE,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,IAAI,CAAC,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAC5F;;;;;;;;OAQG;IACH,OAAO,CACL,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAC7D,OAAO,CAAC,MAAM,CAAC,CAAC;CACpB"}
|
package/dist/types.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
// `env.db`
|
|
1
|
+
// The surface of `env.db` (docs/env-db-assembly.md §8,
|
|
2
|
+
// docs/pg-driver-support.md §3.1).
|
|
2
3
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
4
|
+
// What is written here is everything the adapter expects. The system worker's
|
|
5
|
+
// `Db` facade is canonical and this file is a copy of its shape carried over
|
|
6
|
+
// into TypeScript — if the two drift apart the adapter quietly produces wrong
|
|
7
|
+
// values, so when the facade changes this changes with it.
|
|
6
8
|
export {};
|
|
7
9
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,mCAAmC;AACnC,EAAE;AACF,8EAA8E;AAC9E,6EAA6E;AAC7E,8EAA8E;AAC9E,2DAA2D"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runlot/pg",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.0-rc.170",
|
|
4
|
+
"description": "node-postgres-compatible adapter for env.db, with adapters for six ORMs",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -45,13 +45,18 @@
|
|
|
45
45
|
"./bundler": {
|
|
46
46
|
"types": "./dist/bundler.d.ts",
|
|
47
47
|
"default": "./dist/bundler.js"
|
|
48
|
+
},
|
|
49
|
+
"./type-parsers": {
|
|
50
|
+
"types": "./dist/type-parsers.d.ts",
|
|
51
|
+
"default": "./dist/type-parsers.js"
|
|
48
52
|
}
|
|
49
53
|
},
|
|
50
54
|
"files": [
|
|
51
55
|
"dist"
|
|
52
56
|
],
|
|
53
57
|
"dependencies": {
|
|
54
|
-
"esbuild": "^0.24.2"
|
|
58
|
+
"esbuild": "^0.24.2",
|
|
59
|
+
"@prisma/driver-adapter-utils": "7.10.0"
|
|
55
60
|
},
|
|
56
61
|
"devDependencies": {
|
|
57
62
|
"@types/node": "^22.10.2",
|
|
@@ -66,7 +71,7 @@
|
|
|
66
71
|
"@prisma/client": "7.10.0",
|
|
67
72
|
"@prisma/driver-adapter-utils": "7.10.0",
|
|
68
73
|
"prisma": "7.10.0",
|
|
69
|
-
"@runlot/config": "0.1.0-rc.
|
|
74
|
+
"@runlot/config": "0.1.0-rc.170"
|
|
70
75
|
},
|
|
71
76
|
"scripts": {
|
|
72
77
|
"build": "tsc -p tsconfig.build.json",
|