@runlot/pg 0.1.0-rc.100
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 +60 -0
- package/dist/bundler.d.ts +33 -0
- package/dist/bundler.d.ts.map +1 -0
- package/dist/bundler.js +276 -0
- package/dist/bundler.js.map +1 -0
- package/dist/client.d.ts +138 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +505 -0
- package/dist/client.js.map +1 -0
- package/dist/emitter.d.ts +14 -0
- package/dist/emitter.d.ts.map +1 -0
- package/dist/emitter.js +63 -0
- package/dist/emitter.js.map +1 -0
- package/dist/errors.d.ts +34 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +46 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +94 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/orm/drizzle.d.ts +9 -0
- package/dist/orm/drizzle.d.ts.map +1 -0
- package/dist/orm/drizzle.js +13 -0
- package/dist/orm/drizzle.js.map +1 -0
- package/dist/orm/knex.d.ts +6 -0
- package/dist/orm/knex.d.ts.map +1 -0
- package/dist/orm/knex.js +28 -0
- package/dist/orm/knex.js.map +1 -0
- package/dist/orm/kysely.d.ts +5 -0
- package/dist/orm/kysely.d.ts.map +1 -0
- package/dist/orm/kysely.js +14 -0
- package/dist/orm/kysely.js.map +1 -0
- package/dist/orm/prisma.d.ts +49 -0
- package/dist/orm/prisma.d.ts.map +1 -0
- package/dist/orm/prisma.js +344 -0
- package/dist/orm/prisma.js.map +1 -0
- package/dist/orm/sequelize.d.ts +4 -0
- package/dist/orm/sequelize.d.ts.map +1 -0
- package/dist/orm/sequelize.js +24 -0
- package/dist/orm/sequelize.js.map +1 -0
- package/dist/orm/typeorm.d.ts +11 -0
- package/dist/orm/typeorm.d.ts.map +1 -0
- package/dist/orm/typeorm.js +22 -0
- package/dist/orm/typeorm.js.map +1 -0
- package/dist/type-parsers.d.ts +159 -0
- package/dist/type-parsers.d.ts.map +1 -0
- package/dist/type-parsers.js +329 -0
- package/dist/type-parsers.js.map +1 -0
- package/dist/types.d.ts +93 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -0
- package/package.json +83 -0
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
// Prisma driver adapter — puts the same shape as `@prisma/adapter-pg` on top
|
|
2
|
+
// of `@runlot/pg` (docs/pg-driver-support.md §3.3).
|
|
3
|
+
//
|
|
4
|
+
// In the Prisma 7 client the query compiler is WASM and the adapter does the
|
|
5
|
+
// execution. The adapter does three things: result column OID → Prisma
|
|
6
|
+
// ColumnType, arguments → text parameters, and a transaction = BEGIN/COMMIT on
|
|
7
|
+
// a PoolClient.
|
|
8
|
+
import { ColumnTypeEnum, DriverAdapterError, } from "@prisma/driver-adapter-utils";
|
|
9
|
+
import { Pool, PoolClient } from "../client.js";
|
|
10
|
+
import { DatabaseError } from "../errors.js";
|
|
11
|
+
import { builtins, parseArray } from "../type-parsers.js";
|
|
12
|
+
const ADAPTER_NAME = "@runlot/pg/prisma";
|
|
13
|
+
const FIRST_NORMAL_OBJECT_ID = 16384;
|
|
14
|
+
const A = {
|
|
15
|
+
BIT_ARRAY: 1561, BOOL_ARRAY: 1000, BYTEA_ARRAY: 1001, BPCHAR_ARRAY: 1014, CHAR_ARRAY: 1002,
|
|
16
|
+
CIDR_ARRAY: 651, DATE_ARRAY: 1182, FLOAT4_ARRAY: 1021, FLOAT8_ARRAY: 1022, INET_ARRAY: 1041,
|
|
17
|
+
INT2_ARRAY: 1005, INT4_ARRAY: 1007, INT8_ARRAY: 1016, JSONB_ARRAY: 3807, JSON_ARRAY: 199,
|
|
18
|
+
MONEY_ARRAY: 791, NUMERIC_ARRAY: 1231, OID_ARRAY: 1028, TEXT_ARRAY: 1009, TIMESTAMP_ARRAY: 1115,
|
|
19
|
+
TIMESTAMPTZ_ARRAY: 1185, TIME_ARRAY: 1183, UUID_ARRAY: 2951, VARBIT_ARRAY: 1563, VARCHAR_ARRAY: 1015,
|
|
20
|
+
XML_ARRAY: 143,
|
|
21
|
+
};
|
|
22
|
+
function columnType(oid) {
|
|
23
|
+
switch (oid) {
|
|
24
|
+
case builtins.INT2:
|
|
25
|
+
case builtins.INT4:
|
|
26
|
+
return ColumnTypeEnum.Int32;
|
|
27
|
+
case builtins.INT8:
|
|
28
|
+
case builtins.OID:
|
|
29
|
+
return ColumnTypeEnum.Int64;
|
|
30
|
+
case builtins.FLOAT4:
|
|
31
|
+
return ColumnTypeEnum.Float;
|
|
32
|
+
case builtins.FLOAT8:
|
|
33
|
+
return ColumnTypeEnum.Double;
|
|
34
|
+
case builtins.BOOL:
|
|
35
|
+
return ColumnTypeEnum.Boolean;
|
|
36
|
+
case builtins.DATE:
|
|
37
|
+
return ColumnTypeEnum.Date;
|
|
38
|
+
case builtins.TIME:
|
|
39
|
+
case builtins.TIMETZ:
|
|
40
|
+
return ColumnTypeEnum.Time;
|
|
41
|
+
case builtins.TIMESTAMP:
|
|
42
|
+
case builtins.TIMESTAMPTZ:
|
|
43
|
+
return ColumnTypeEnum.DateTime;
|
|
44
|
+
case builtins.NUMERIC:
|
|
45
|
+
case builtins.MONEY:
|
|
46
|
+
return ColumnTypeEnum.Numeric;
|
|
47
|
+
case builtins.JSON:
|
|
48
|
+
case builtins.JSONB:
|
|
49
|
+
return ColumnTypeEnum.Json;
|
|
50
|
+
case builtins.UUID:
|
|
51
|
+
return ColumnTypeEnum.Uuid;
|
|
52
|
+
case builtins.BPCHAR:
|
|
53
|
+
case builtins.TEXT:
|
|
54
|
+
case builtins.VARCHAR:
|
|
55
|
+
case builtins.BIT:
|
|
56
|
+
case builtins.VARBIT:
|
|
57
|
+
case builtins.INET:
|
|
58
|
+
case builtins.CIDR:
|
|
59
|
+
case builtins.XML:
|
|
60
|
+
case 19: // name
|
|
61
|
+
return ColumnTypeEnum.Text;
|
|
62
|
+
case builtins.BYTEA:
|
|
63
|
+
return ColumnTypeEnum.Bytes;
|
|
64
|
+
case A.INT2_ARRAY:
|
|
65
|
+
case A.INT4_ARRAY:
|
|
66
|
+
return ColumnTypeEnum.Int32Array;
|
|
67
|
+
case A.FLOAT4_ARRAY:
|
|
68
|
+
return ColumnTypeEnum.FloatArray;
|
|
69
|
+
case A.FLOAT8_ARRAY:
|
|
70
|
+
return ColumnTypeEnum.DoubleArray;
|
|
71
|
+
case A.NUMERIC_ARRAY:
|
|
72
|
+
case A.MONEY_ARRAY:
|
|
73
|
+
return ColumnTypeEnum.NumericArray;
|
|
74
|
+
case A.BOOL_ARRAY:
|
|
75
|
+
return ColumnTypeEnum.BooleanArray;
|
|
76
|
+
case A.CHAR_ARRAY:
|
|
77
|
+
return ColumnTypeEnum.CharacterArray;
|
|
78
|
+
case A.BPCHAR_ARRAY:
|
|
79
|
+
case A.TEXT_ARRAY:
|
|
80
|
+
case A.VARCHAR_ARRAY:
|
|
81
|
+
case A.VARBIT_ARRAY:
|
|
82
|
+
case A.BIT_ARRAY:
|
|
83
|
+
case A.INET_ARRAY:
|
|
84
|
+
case A.CIDR_ARRAY:
|
|
85
|
+
case A.XML_ARRAY:
|
|
86
|
+
return ColumnTypeEnum.TextArray;
|
|
87
|
+
case A.DATE_ARRAY:
|
|
88
|
+
return ColumnTypeEnum.DateArray;
|
|
89
|
+
case A.TIME_ARRAY:
|
|
90
|
+
return ColumnTypeEnum.TimeArray;
|
|
91
|
+
case A.TIMESTAMP_ARRAY:
|
|
92
|
+
case A.TIMESTAMPTZ_ARRAY:
|
|
93
|
+
return ColumnTypeEnum.DateTimeArray;
|
|
94
|
+
case A.JSON_ARRAY:
|
|
95
|
+
case A.JSONB_ARRAY:
|
|
96
|
+
return ColumnTypeEnum.JsonArray;
|
|
97
|
+
case A.BYTEA_ARRAY:
|
|
98
|
+
return ColumnTypeEnum.BytesArray;
|
|
99
|
+
case A.UUID_ARRAY:
|
|
100
|
+
return ColumnTypeEnum.UuidArray;
|
|
101
|
+
case A.INT8_ARRAY:
|
|
102
|
+
case A.OID_ARRAY:
|
|
103
|
+
return ColumnTypeEnum.Int64Array;
|
|
104
|
+
default:
|
|
105
|
+
if (oid >= FIRST_NORMAL_OBJECT_ID)
|
|
106
|
+
return ColumnTypeEnum.Text;
|
|
107
|
+
throw new DriverAdapterError({ kind: "UnsupportedNativeDataType", type: String(oid) });
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// Prisma takes dates, numbers and json as **strings** and interprets them
|
|
111
|
+
// itself (adapter-pg's customParsers). So we hand the text straight through as
|
|
112
|
+
// a per-query parser.
|
|
113
|
+
const text = (s) => s;
|
|
114
|
+
const timestamp = (s) => `${s.replace(" ", "T")}+00:00`;
|
|
115
|
+
const timestamptz = (s) => s.replace(" ", "T").replace(/[+-]\d{2}(:\d{2})?$/, "+00:00");
|
|
116
|
+
const timetz = (s) => s.replace(/[+-]\d{2}(:\d{2})?$/, "");
|
|
117
|
+
const money = (s) => s.slice(1);
|
|
118
|
+
const bytes = (s) => {
|
|
119
|
+
const hex = s.startsWith("\\x") ? s.slice(2) : "";
|
|
120
|
+
const out = new Uint8Array(hex.length >> 1);
|
|
121
|
+
for (let i = 0; i < out.length; i++)
|
|
122
|
+
out[i] = parseInt(hex.slice(i * 2, i * 2 + 2), 16);
|
|
123
|
+
return out;
|
|
124
|
+
};
|
|
125
|
+
const prismaParsers = new Map([
|
|
126
|
+
[builtins.NUMERIC, text],
|
|
127
|
+
[A.NUMERIC_ARRAY, (s) => parseArray(s, text)],
|
|
128
|
+
[builtins.TIME, text],
|
|
129
|
+
[A.TIME_ARRAY, (s) => parseArray(s, text)],
|
|
130
|
+
[builtins.TIMETZ, timetz],
|
|
131
|
+
[builtins.DATE, text],
|
|
132
|
+
[A.DATE_ARRAY, (s) => parseArray(s, text)],
|
|
133
|
+
[builtins.TIMESTAMP, timestamp],
|
|
134
|
+
[A.TIMESTAMP_ARRAY, (s) => parseArray(s, timestamp)],
|
|
135
|
+
[builtins.TIMESTAMPTZ, timestamptz],
|
|
136
|
+
[A.TIMESTAMPTZ_ARRAY, (s) => parseArray(s, timestamptz)],
|
|
137
|
+
[builtins.MONEY, money],
|
|
138
|
+
[A.MONEY_ARRAY, (s) => parseArray(s, money)],
|
|
139
|
+
[builtins.JSON, text],
|
|
140
|
+
[A.JSON_ARRAY, (s) => parseArray(s, text)],
|
|
141
|
+
[builtins.JSONB, text],
|
|
142
|
+
[A.JSONB_ARRAY, (s) => parseArray(s, text)],
|
|
143
|
+
[builtins.BYTEA, bytes],
|
|
144
|
+
[A.BYTEA_ARRAY, (s) => parseArray(s, bytes)],
|
|
145
|
+
[A.BIT_ARRAY, (s) => parseArray(s, text)],
|
|
146
|
+
[A.VARBIT_ARRAY, (s) => parseArray(s, text)],
|
|
147
|
+
[A.XML_ARRAY, (s) => parseArray(s, text)],
|
|
148
|
+
]);
|
|
149
|
+
const pad = (n, z = 2) => String(n).padStart(z, "0");
|
|
150
|
+
function fmtDateTime(d) {
|
|
151
|
+
const ms = d.getUTCMilliseconds();
|
|
152
|
+
return `${pad(d.getUTCFullYear(), 4)}-${pad(d.getUTCMonth() + 1)}-${pad(d.getUTCDate())} ${pad(d.getUTCHours())}:${pad(d.getUTCMinutes())}:${pad(d.getUTCSeconds())}${ms ? "." + pad(ms, 3) : ""}`;
|
|
153
|
+
}
|
|
154
|
+
function fmtDate(d) {
|
|
155
|
+
return `${pad(d.getUTCFullYear(), 4)}-${pad(d.getUTCMonth() + 1)}-${pad(d.getUTCDate())}`;
|
|
156
|
+
}
|
|
157
|
+
function fmtTime(d) {
|
|
158
|
+
const ms = d.getUTCMilliseconds();
|
|
159
|
+
return `${pad(d.getUTCHours())}:${pad(d.getUTCMinutes())}:${pad(d.getUTCSeconds())}${ms ? "." + pad(ms, 3) : ""}`;
|
|
160
|
+
}
|
|
161
|
+
function mapArg(arg, argType) {
|
|
162
|
+
if (arg === null)
|
|
163
|
+
return null;
|
|
164
|
+
if (Array.isArray(arg) && argType.arity === "list")
|
|
165
|
+
return arg.map((v) => mapArg(v, argType));
|
|
166
|
+
if (typeof arg === "string" && argType.scalarType === "datetime")
|
|
167
|
+
arg = new Date(arg);
|
|
168
|
+
if (arg instanceof Date) {
|
|
169
|
+
switch (argType.dbType) {
|
|
170
|
+
case "TIME":
|
|
171
|
+
case "TIMETZ":
|
|
172
|
+
return fmtTime(arg);
|
|
173
|
+
case "DATE":
|
|
174
|
+
return fmtDate(arg);
|
|
175
|
+
default:
|
|
176
|
+
return fmtDateTime(arg);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
if (typeof arg === "string" && argType.scalarType === "bytes") {
|
|
180
|
+
const bin = atob(arg);
|
|
181
|
+
const out = new Uint8Array(bin.length);
|
|
182
|
+
for (let i = 0; i < bin.length; i++)
|
|
183
|
+
out[i] = bin.charCodeAt(i);
|
|
184
|
+
return out;
|
|
185
|
+
}
|
|
186
|
+
if (ArrayBuffer.isView(arg))
|
|
187
|
+
return new Uint8Array(arg.buffer, arg.byteOffset, arg.byteLength);
|
|
188
|
+
return arg;
|
|
189
|
+
}
|
|
190
|
+
function convertError(e) {
|
|
191
|
+
if (e instanceof DatabaseError) {
|
|
192
|
+
const detail = e.detail;
|
|
193
|
+
const fields = detail?.match(/Key \(([^)]+)\)/)?.[1]?.split(", ");
|
|
194
|
+
switch (e.code) {
|
|
195
|
+
case "22001":
|
|
196
|
+
throw new DriverAdapterError({ kind: "LengthMismatch", originalCode: e.code, originalMessage: e.message });
|
|
197
|
+
case "23505":
|
|
198
|
+
throw new DriverAdapterError({ kind: "UniqueConstraintViolation", constraint: fields ? { fields } : undefined, originalCode: e.code, originalMessage: e.message });
|
|
199
|
+
case "23502":
|
|
200
|
+
throw new DriverAdapterError({ kind: "NullConstraintViolation", constraint: fields ? { fields } : undefined, originalCode: e.code, originalMessage: e.message });
|
|
201
|
+
case "23503":
|
|
202
|
+
throw new DriverAdapterError({ kind: "ForeignKeyConstraintViolation", originalCode: e.code, originalMessage: e.message });
|
|
203
|
+
case "40001":
|
|
204
|
+
case "40P01":
|
|
205
|
+
throw new DriverAdapterError({ kind: "TransactionWriteConflict", originalCode: e.code, originalMessage: e.message });
|
|
206
|
+
case "42P01":
|
|
207
|
+
throw new DriverAdapterError({ kind: "TableDoesNotExist", table: e.message.split(" ")[1]?.split('"')[1], originalCode: e.code, originalMessage: e.message });
|
|
208
|
+
case "42703":
|
|
209
|
+
throw new DriverAdapterError({ kind: "ColumnNotFound", column: e.message.match(/^column (.+) does not exist$/)?.[1], originalCode: e.code, originalMessage: e.message });
|
|
210
|
+
case "53300":
|
|
211
|
+
throw new DriverAdapterError({ kind: "TooManyConnections", cause: e.message, originalCode: e.code, originalMessage: e.message });
|
|
212
|
+
default:
|
|
213
|
+
throw new DriverAdapterError({
|
|
214
|
+
kind: "postgres",
|
|
215
|
+
code: e.code,
|
|
216
|
+
severity: e.severity,
|
|
217
|
+
message: e.message,
|
|
218
|
+
detail: e.detail,
|
|
219
|
+
column: undefined,
|
|
220
|
+
hint: e.hint,
|
|
221
|
+
originalCode: e.code,
|
|
222
|
+
originalMessage: e.message,
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
throw e;
|
|
227
|
+
}
|
|
228
|
+
class Queryable {
|
|
229
|
+
client;
|
|
230
|
+
provider = "postgres";
|
|
231
|
+
adapterName = ADAPTER_NAME;
|
|
232
|
+
constructor(client) {
|
|
233
|
+
this.client = client;
|
|
234
|
+
}
|
|
235
|
+
async queryRaw(query) {
|
|
236
|
+
const { fields, rows } = await this.perform(query);
|
|
237
|
+
return {
|
|
238
|
+
columnNames: fields.map((f) => f.name),
|
|
239
|
+
columnTypes: fields.map((f) => columnType(f.dataTypeID)),
|
|
240
|
+
rows: rows,
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
async executeRaw(query) {
|
|
244
|
+
return (await this.perform(query)).rowCount ?? 0;
|
|
245
|
+
}
|
|
246
|
+
async perform(query) {
|
|
247
|
+
const values = query.args.map((a, i) => mapArg(a, query.argTypes[i]));
|
|
248
|
+
try {
|
|
249
|
+
return await this.client.query({
|
|
250
|
+
text: query.sql,
|
|
251
|
+
values,
|
|
252
|
+
rowMode: "array",
|
|
253
|
+
types: { getTypeParser: (oid) => prismaParsers.get(oid) ?? defaultParser(oid) },
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
catch (e) {
|
|
257
|
+
convertError(e);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
// A type for which Prisma registered no parser gets pg's default parser —
|
|
262
|
+
// which is the same as our adapter's default conversion. That conversion is
|
|
263
|
+
// what `convertCell` does without a lookup, so what we would want to return
|
|
264
|
+
// here is undefined rather than an identity meaning "not registered", but pg's
|
|
265
|
+
// `types.getTypeParser` always returns a function. So we hand back the text as
|
|
266
|
+
// it is. (int/bool/float are interpreted by Prisma itself through
|
|
267
|
+
// ColumnType.)
|
|
268
|
+
function defaultParser(_oid) {
|
|
269
|
+
return text;
|
|
270
|
+
}
|
|
271
|
+
class RunlotTransaction extends Queryable {
|
|
272
|
+
conn;
|
|
273
|
+
options;
|
|
274
|
+
constructor(conn, options) {
|
|
275
|
+
super(conn);
|
|
276
|
+
this.conn = conn;
|
|
277
|
+
this.options = options;
|
|
278
|
+
}
|
|
279
|
+
async commit() {
|
|
280
|
+
this.conn.release();
|
|
281
|
+
}
|
|
282
|
+
async rollback() {
|
|
283
|
+
this.conn.release();
|
|
284
|
+
}
|
|
285
|
+
async createSavepoint(name) {
|
|
286
|
+
await this.executeRaw({ sql: `SAVEPOINT ${name}`, args: [], argTypes: [] });
|
|
287
|
+
}
|
|
288
|
+
async rollbackToSavepoint(name) {
|
|
289
|
+
await this.executeRaw({ sql: `ROLLBACK TO SAVEPOINT ${name}`, args: [], argTypes: [] });
|
|
290
|
+
}
|
|
291
|
+
async releaseSavepoint(name) {
|
|
292
|
+
await this.executeRaw({ sql: `RELEASE SAVEPOINT ${name}`, args: [], argTypes: [] });
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
export class RunlotPrismaAdapter extends Queryable {
|
|
296
|
+
pool;
|
|
297
|
+
constructor(pool) {
|
|
298
|
+
super(pool);
|
|
299
|
+
this.pool = pool;
|
|
300
|
+
}
|
|
301
|
+
async startTransaction(isolationLevel) {
|
|
302
|
+
const conn = await this.pool.connect().catch(convertError);
|
|
303
|
+
const tx = new RunlotTransaction(conn, { usePhantomQuery: false });
|
|
304
|
+
try {
|
|
305
|
+
await tx.executeRaw({ sql: "BEGIN", args: [], argTypes: [] });
|
|
306
|
+
if (isolationLevel)
|
|
307
|
+
await tx.executeRaw({ sql: `SET TRANSACTION ISOLATION LEVEL ${isolationLevel}`, args: [], argTypes: [] });
|
|
308
|
+
return tx;
|
|
309
|
+
}
|
|
310
|
+
catch (e) {
|
|
311
|
+
conn.release(e);
|
|
312
|
+
throw e;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
async executeScript(script) {
|
|
316
|
+
for (const stmt of script.split(";").map((s) => s.trim()).filter(Boolean)) {
|
|
317
|
+
try {
|
|
318
|
+
await this.pool.query(stmt);
|
|
319
|
+
}
|
|
320
|
+
catch (e) {
|
|
321
|
+
convertError(e);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
getConnectionInfo() {
|
|
326
|
+
return { supportsRelationJoins: true };
|
|
327
|
+
}
|
|
328
|
+
async dispose() {
|
|
329
|
+
await this.pool.end();
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
/** `new PrismaClient({ adapter: new PrismaRunlot(env.db) })`. */
|
|
333
|
+
export class PrismaRunlot {
|
|
334
|
+
db;
|
|
335
|
+
provider = "postgres";
|
|
336
|
+
adapterName = ADAPTER_NAME;
|
|
337
|
+
constructor(db) {
|
|
338
|
+
this.db = db;
|
|
339
|
+
}
|
|
340
|
+
async connect() {
|
|
341
|
+
return new RunlotPrismaAdapter(new Pool({ db: this.db }));
|
|
342
|
+
}
|
|
343
|
+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C,CAAC;YAC9B,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,YAAY,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;QACH,CAAC;IACH,CAAC;IAED,iBAAiB;QACf,OAAO,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,OAAO;QACX,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;IACxB,CAAC;CACF;AAED,iEAAiE;AACjE,MAAM,OAAO,YAAY;IAGM;IAFpB,QAAQ,GAAG,UAAmB,CAAC;IAC/B,WAAW,GAAG,YAAY,CAAC;IACpC,YAA6B,EAAM;QAAN,OAAE,GAAF,EAAE,CAAI;IAAG,CAAC;IACvC,KAAK,CAAC,OAAO;QACX,OAAO,IAAI,mBAAmB,CAAC,IAAI,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAC5D,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sequelize.d.ts","sourceRoot":"","sources":["../../src/orm/sequelize.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEtC,wBAAgB,SAAS,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,GAAG,eAAe,CAAC,GAAG,SAAS,CAYjG"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Sequelize: we give our module as the `dialectModule`.
|
|
2
|
+
//
|
|
3
|
+
// Sequelize's pg connection manager calls `new Client(config)` and
|
|
4
|
+
// `connect(cb)`, hooks `client.connection.on('parameterStatus')`, and then
|
|
5
|
+
// sends `SET client_min_messages` and friends as a single statement. After
|
|
6
|
+
// that it reads `pg_type` to cache the enum and range OIDs
|
|
7
|
+
// (`_refreshDynamicOIDs`) — which is why the first connection costs one round
|
|
8
|
+
// more.
|
|
9
|
+
import { Sequelize } from "sequelize";
|
|
10
|
+
import { pgModule } from "../client.js";
|
|
11
|
+
export function sequelize(db, options) {
|
|
12
|
+
return new Sequelize({
|
|
13
|
+
...(options ?? {}),
|
|
14
|
+
dialect: "postgres",
|
|
15
|
+
dialectModule: pgModule(db),
|
|
16
|
+
database: "runlot",
|
|
17
|
+
username: "runlot",
|
|
18
|
+
// Sequelize manages the pool with sequelize-pool. Keep it from holding
|
|
19
|
+
// idle sessions.
|
|
20
|
+
pool: { min: 0, max: 4, idle: 1000, ...(options?.pool ?? {}) },
|
|
21
|
+
logging: options?.logging ?? false,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=sequelize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sequelize.js","sourceRoot":"","sources":["../../src/orm/sequelize.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,mEAAmE;AACnE,2EAA2E;AAC3E,2EAA2E;AAC3E,2DAA2D;AAC3D,8EAA8E;AAC9E,QAAQ;AACR,OAAO,EAAE,SAAS,EAAgB,MAAM,WAAW,CAAC;AAEpD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxC,MAAM,UAAU,SAAS,CAAC,EAAM,EAAE,OAAoD;IACpF,OAAO,IAAI,SAAS,CAAC;QACnB,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC;QAClB,OAAO,EAAE,UAAU;QACnB,aAAa,EAAE,QAAQ,CAAC,EAAE,CAAC;QAC3B,QAAQ,EAAE,QAAQ;QAClB,QAAQ,EAAE,QAAQ;QAClB,uEAAuE;QACvE,iBAAiB;QACjB,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,EAAE;QAC9D,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,KAAK;KACnC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "reflect-metadata";
|
|
2
|
+
import { DataSource, type DataSourceOptions } from "typeorm";
|
|
3
|
+
import type { Db } from "../types.js";
|
|
4
|
+
type PostgresOptions = Extract<DataSourceOptions, {
|
|
5
|
+
type: "postgres";
|
|
6
|
+
}>;
|
|
7
|
+
export type TypeormOptions = Omit<PostgresOptions, "type" | "driver" | "url" | "host" | "port" | "username" | "password" | "database">;
|
|
8
|
+
export declare function dataSourceOptions(db: Db, options: TypeormOptions): DataSourceOptions;
|
|
9
|
+
export declare function dataSource(db: Db, options: TypeormOptions): DataSource;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=typeorm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeorm.d.ts","sourceRoot":"","sources":["../../src/orm/typeorm.ts"],"names":[],"mappings":"AAMA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAG7D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEtC,KAAK,eAAe,GAAG,OAAO,CAAC,iBAAiB,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,CAAC;AACxE,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC,CAAC;AAEvI,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,cAAc,GAAG,iBAAiB,CAQpF;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,cAAc,GAAG,UAAU,CAEtE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// TypeORM: the module is injected into the `postgres` driver through the
|
|
2
|
+
// `driver` option (PostgresDriver.loadDependencies). It constructs that
|
|
3
|
+
// module's `Pool` with its own options, so a module with `db` already bound is
|
|
4
|
+
// needed.
|
|
5
|
+
//
|
|
6
|
+
// TypeORM requires `reflect-metadata` globally — it is imported here.
|
|
7
|
+
import "reflect-metadata";
|
|
8
|
+
import { DataSource } from "typeorm";
|
|
9
|
+
import { pgModule } from "../client.js";
|
|
10
|
+
export function dataSourceOptions(db, options) {
|
|
11
|
+
return {
|
|
12
|
+
...options,
|
|
13
|
+
type: "postgres",
|
|
14
|
+
driver: pgModule(db),
|
|
15
|
+
// The value is not used, but TypeORM warns about empty credentials.
|
|
16
|
+
database: "runlot",
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export function dataSource(db, options) {
|
|
20
|
+
return new DataSource(dataSourceOptions(db, options));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=typeorm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeorm.js","sourceRoot":"","sources":["../../src/orm/typeorm.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,wEAAwE;AACxE,+EAA+E;AAC/E,UAAU;AACV,EAAE;AACF,sEAAsE;AACtE,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAA0B,MAAM,SAAS,CAAC;AAE7D,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAMxC,MAAM,UAAU,iBAAiB,CAAC,EAAM,EAAE,OAAuB;IAC/D,OAAO;QACL,GAAG,OAAO;QACV,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC;QACpB,oEAAoE;QACpE,QAAQ,EAAE,QAAQ;KACE,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,EAAM,EAAE,OAAuB;IACxD,OAAO,IAAI,UAAU,CAAC,iBAAiB,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
export type TypeParser = (text: string) => unknown;
|
|
2
|
+
/** pg-types' builtins. The OIDs are the stable values from pg_catalog. */
|
|
3
|
+
export declare const builtins: {
|
|
4
|
+
readonly BOOL: 16;
|
|
5
|
+
readonly BYTEA: 17;
|
|
6
|
+
readonly CHAR: 18;
|
|
7
|
+
readonly INT8: 20;
|
|
8
|
+
readonly INT2: 21;
|
|
9
|
+
readonly INT4: 23;
|
|
10
|
+
readonly REGPROC: 24;
|
|
11
|
+
readonly TEXT: 25;
|
|
12
|
+
readonly OID: 26;
|
|
13
|
+
readonly TID: 27;
|
|
14
|
+
readonly XID: 28;
|
|
15
|
+
readonly CID: 29;
|
|
16
|
+
readonly JSON: 114;
|
|
17
|
+
readonly XML: 142;
|
|
18
|
+
readonly PG_NODE_TREE: 194;
|
|
19
|
+
readonly SMGR: 210;
|
|
20
|
+
readonly PATH: 602;
|
|
21
|
+
readonly POLYGON: 604;
|
|
22
|
+
readonly CIDR: 650;
|
|
23
|
+
readonly FLOAT4: 700;
|
|
24
|
+
readonly FLOAT8: 701;
|
|
25
|
+
readonly ABSTIME: 702;
|
|
26
|
+
readonly RELTIME: 703;
|
|
27
|
+
readonly TINTERVAL: 704;
|
|
28
|
+
readonly CIRCLE: 718;
|
|
29
|
+
readonly MACADDR8: 774;
|
|
30
|
+
readonly MONEY: 790;
|
|
31
|
+
readonly MACADDR: 829;
|
|
32
|
+
readonly INET: 869;
|
|
33
|
+
readonly ACLITEM: 1033;
|
|
34
|
+
readonly BPCHAR: 1042;
|
|
35
|
+
readonly VARCHAR: 1043;
|
|
36
|
+
readonly DATE: 1082;
|
|
37
|
+
readonly TIME: 1083;
|
|
38
|
+
readonly TIMESTAMP: 1114;
|
|
39
|
+
readonly TIMESTAMPTZ: 1184;
|
|
40
|
+
readonly INTERVAL: 1186;
|
|
41
|
+
readonly TIMETZ: 1266;
|
|
42
|
+
readonly BIT: 1560;
|
|
43
|
+
readonly VARBIT: 1562;
|
|
44
|
+
readonly NUMERIC: 1700;
|
|
45
|
+
readonly REFCURSOR: 1790;
|
|
46
|
+
readonly REGPROCEDURE: 2202;
|
|
47
|
+
readonly REGOPER: 2203;
|
|
48
|
+
readonly REGOPERATOR: 2204;
|
|
49
|
+
readonly REGCLASS: 2205;
|
|
50
|
+
readonly REGTYPE: 2206;
|
|
51
|
+
readonly UUID: 2950;
|
|
52
|
+
readonly TXID_SNAPSHOT: 2970;
|
|
53
|
+
readonly PG_LSN: 3220;
|
|
54
|
+
readonly PG_NDISTINCT: 3361;
|
|
55
|
+
readonly PG_DEPENDENCIES: 3402;
|
|
56
|
+
readonly TSVECTOR: 3614;
|
|
57
|
+
readonly TSQUERY: 3615;
|
|
58
|
+
readonly GTSVECTOR: 3642;
|
|
59
|
+
readonly REGCONFIG: 3734;
|
|
60
|
+
readonly REGDICTIONARY: 3769;
|
|
61
|
+
readonly JSONB: 3802;
|
|
62
|
+
readonly REGNAMESPACE: 4089;
|
|
63
|
+
readonly REGROLE: 4096;
|
|
64
|
+
};
|
|
65
|
+
/** A parser for PostgreSQL array text ('{a,b}'). It handles nesting and
|
|
66
|
+
* quoting. */
|
|
67
|
+
export declare function parseArray(text: string, element?: TypeParser): unknown[];
|
|
68
|
+
export declare function getTypeParser(oid: number, format?: "text" | "binary"): TypeParser;
|
|
69
|
+
export declare function setTypeParser(oid: number, format: "text" | "binary" | TypeParser, parser?: TypeParser): void;
|
|
70
|
+
/** The object handed over as `pg.types`. */
|
|
71
|
+
export declare const types: {
|
|
72
|
+
builtins: {
|
|
73
|
+
readonly BOOL: 16;
|
|
74
|
+
readonly BYTEA: 17;
|
|
75
|
+
readonly CHAR: 18;
|
|
76
|
+
readonly INT8: 20;
|
|
77
|
+
readonly INT2: 21;
|
|
78
|
+
readonly INT4: 23;
|
|
79
|
+
readonly REGPROC: 24;
|
|
80
|
+
readonly TEXT: 25;
|
|
81
|
+
readonly OID: 26;
|
|
82
|
+
readonly TID: 27;
|
|
83
|
+
readonly XID: 28;
|
|
84
|
+
readonly CID: 29;
|
|
85
|
+
readonly JSON: 114;
|
|
86
|
+
readonly XML: 142;
|
|
87
|
+
readonly PG_NODE_TREE: 194;
|
|
88
|
+
readonly SMGR: 210;
|
|
89
|
+
readonly PATH: 602;
|
|
90
|
+
readonly POLYGON: 604;
|
|
91
|
+
readonly CIDR: 650;
|
|
92
|
+
readonly FLOAT4: 700;
|
|
93
|
+
readonly FLOAT8: 701;
|
|
94
|
+
readonly ABSTIME: 702;
|
|
95
|
+
readonly RELTIME: 703;
|
|
96
|
+
readonly TINTERVAL: 704;
|
|
97
|
+
readonly CIRCLE: 718;
|
|
98
|
+
readonly MACADDR8: 774;
|
|
99
|
+
readonly MONEY: 790;
|
|
100
|
+
readonly MACADDR: 829;
|
|
101
|
+
readonly INET: 869;
|
|
102
|
+
readonly ACLITEM: 1033;
|
|
103
|
+
readonly BPCHAR: 1042;
|
|
104
|
+
readonly VARCHAR: 1043;
|
|
105
|
+
readonly DATE: 1082;
|
|
106
|
+
readonly TIME: 1083;
|
|
107
|
+
readonly TIMESTAMP: 1114;
|
|
108
|
+
readonly TIMESTAMPTZ: 1184;
|
|
109
|
+
readonly INTERVAL: 1186;
|
|
110
|
+
readonly TIMETZ: 1266;
|
|
111
|
+
readonly BIT: 1560;
|
|
112
|
+
readonly VARBIT: 1562;
|
|
113
|
+
readonly NUMERIC: 1700;
|
|
114
|
+
readonly REFCURSOR: 1790;
|
|
115
|
+
readonly REGPROCEDURE: 2202;
|
|
116
|
+
readonly REGOPER: 2203;
|
|
117
|
+
readonly REGOPERATOR: 2204;
|
|
118
|
+
readonly REGCLASS: 2205;
|
|
119
|
+
readonly REGTYPE: 2206;
|
|
120
|
+
readonly UUID: 2950;
|
|
121
|
+
readonly TXID_SNAPSHOT: 2970;
|
|
122
|
+
readonly PG_LSN: 3220;
|
|
123
|
+
readonly PG_NDISTINCT: 3361;
|
|
124
|
+
readonly PG_DEPENDENCIES: 3402;
|
|
125
|
+
readonly TSVECTOR: 3614;
|
|
126
|
+
readonly TSQUERY: 3615;
|
|
127
|
+
readonly GTSVECTOR: 3642;
|
|
128
|
+
readonly REGCONFIG: 3734;
|
|
129
|
+
readonly REGDICTIONARY: 3769;
|
|
130
|
+
readonly JSONB: 3802;
|
|
131
|
+
readonly REGNAMESPACE: 4089;
|
|
132
|
+
readonly REGROLE: 4096;
|
|
133
|
+
};
|
|
134
|
+
getTypeParser: typeof getTypeParser;
|
|
135
|
+
setTypeParser: typeof setTypeParser;
|
|
136
|
+
arrayParser: {
|
|
137
|
+
create: (s: string, p: TypeParser) => {
|
|
138
|
+
parse: () => unknown[];
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* The facade hands cells over already decoded (the §8 table). The parser table
|
|
144
|
+
* takes text, so we turn them back. It is the lossless direction: a number was
|
|
145
|
+
* only made where the facade could hold it exactly, and json has the same value
|
|
146
|
+
* after being serialised back to a string.
|
|
147
|
+
*/
|
|
148
|
+
export declare function cellToText(cell: unknown, oid: number): string | null;
|
|
149
|
+
/**
|
|
150
|
+
* Moves one cell into the public value.
|
|
151
|
+
*
|
|
152
|
+
* When there is a registered parser (global or per query), we turn the cell
|
|
153
|
+
* back into text and feed it to that. When there is not, we leave the facade's
|
|
154
|
+
* decoding alone and only fix the places where it differs from the pg default:
|
|
155
|
+
* date-like types become a Date, bytea becomes a Uint8Array, an array becomes
|
|
156
|
+
* an array.
|
|
157
|
+
*/
|
|
158
|
+
export declare function convertCell(cell: unknown, oid: number, lookup?: (oid: number, format: "text") => TypeParser): unknown;
|
|
159
|
+
//# sourceMappingURL=type-parsers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-parsers.d.ts","sourceRoot":"","sources":["../src/type-parsers.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;AAEnD,0EAA0E;AAC1E,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6DX,CAAC;AA2DX;eACe;AACf,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,UAAqB,GAAG,OAAO,EAAE,CA6ClF;AA8CD,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,GAAE,MAAM,GAAG,QAAiB,GAAG,UAAU,CAOzF;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,UAAU,EAAE,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI,CAM5G;AAED,4CAA4C;AAC5C,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAAwE,MAAM,KAAK,UAAU;;;;CAA4C,CAAC;AAI5J;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CASpE;AAeD;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,UAAU,GAAG,OAAO,CA+BrH"}
|