pg-codegen 5.12.0 → 5.13.1
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 +0 -2
- package/emit/barrel.js +7 -1
- package/emit/client.d.ts +5 -0
- package/emit/client.js +132 -0
- package/emit/templates/client.d.ts +135 -0
- package/emit/templates/client.js +214 -0
- package/emit/templates/client.ts +358 -0
- package/esm/emit/barrel.js +7 -1
- package/esm/emit/client.js +94 -0
- package/esm/emit/templates/client.js +209 -0
- package/esm/emit/templates/client.ts +358 -0
- package/esm/generate.js +3 -0
- package/generate.js +3 -0
- package/package.json +6 -4
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prisma-like table client over @constructive-io/query-builder.
|
|
3
|
+
*
|
|
4
|
+
* This is the RUNTIME code that gets copied to generated output. Generated
|
|
5
|
+
* per-schema `db` factories bind one TableClient per table, wiring the
|
|
6
|
+
* generated column metadata and field decoders in so call sites only see
|
|
7
|
+
* camelCase fields, `where` filters in the shared query-spec grammar, and
|
|
8
|
+
* decoded application values.
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This file is read at codegen time and written to output.
|
|
11
|
+
* Any changes here will affect all generated clients.
|
|
12
|
+
*/
|
|
13
|
+
import type { Filter, SqlValue } from '@constructive-io/query-builder';
|
|
14
|
+
import { fn, lit, QueryBuilder } from '@constructive-io/query-builder';
|
|
15
|
+
|
|
16
|
+
/** Anything with pg's `query(text, values)` shape: Pool, PoolClient, Client. */
|
|
17
|
+
export interface Queryable {
|
|
18
|
+
query(text: string, values?: unknown[]): Promise<{ rows: unknown[]; rowCount?: number | null }>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** One generated decoder per field, as emitted in the `<TABLE>_FIELDS` constant. */
|
|
22
|
+
export type FieldDecoders<App> = {
|
|
23
|
+
[K in keyof App]: (value: unknown, label?: string) => App[K];
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/** Table wiring supplied by the generated per-schema `db` factory. */
|
|
27
|
+
export interface TableSpec<App> {
|
|
28
|
+
schema: string;
|
|
29
|
+
table: string;
|
|
30
|
+
columnByField: Record<string, string>;
|
|
31
|
+
fields: FieldDecoders<App>;
|
|
32
|
+
/** camelCase fields backed by json/jsonb columns, serialized on writes. */
|
|
33
|
+
jsonFields?: readonly string[];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Select shape: `{ id: true, name: true }` — same as the GraphQL ORM. */
|
|
37
|
+
export type SelectShape<App> = { [K in keyof App]?: boolean };
|
|
38
|
+
|
|
39
|
+
type TrueKeys<App, S> = {
|
|
40
|
+
[K in keyof S]-?: S[K] extends true ? K & keyof App : never;
|
|
41
|
+
}[keyof S];
|
|
42
|
+
|
|
43
|
+
/** Rows narrow to the selected fields; no `select` returns the full record. */
|
|
44
|
+
export type SelectResult<App, S extends SelectShape<App> | undefined> =
|
|
45
|
+
S extends SelectShape<App>
|
|
46
|
+
? [TrueKeys<App, S>] extends [never]
|
|
47
|
+
? App
|
|
48
|
+
: Pick<App, TrueKeys<App, S>>
|
|
49
|
+
: App;
|
|
50
|
+
|
|
51
|
+
/** Per-field operators from the shared query-spec grammar. */
|
|
52
|
+
export interface FieldOps<V> {
|
|
53
|
+
equalTo?: V;
|
|
54
|
+
notEqualTo?: V;
|
|
55
|
+
distinctFrom?: V;
|
|
56
|
+
notDistinctFrom?: V;
|
|
57
|
+
lessThan?: V;
|
|
58
|
+
lessThanOrEqualTo?: V;
|
|
59
|
+
greaterThan?: V;
|
|
60
|
+
greaterThanOrEqualTo?: V;
|
|
61
|
+
in?: V[];
|
|
62
|
+
notIn?: V[];
|
|
63
|
+
like?: string;
|
|
64
|
+
notLike?: string;
|
|
65
|
+
likeInsensitive?: string;
|
|
66
|
+
notLikeInsensitive?: string;
|
|
67
|
+
includes?: string;
|
|
68
|
+
notIncludes?: string;
|
|
69
|
+
includesInsensitive?: string;
|
|
70
|
+
startsWith?: string;
|
|
71
|
+
endsWith?: string;
|
|
72
|
+
isNull?: boolean;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const FIELD_OP_NAMES: ReadonlySet<string> = new Set([
|
|
76
|
+
'equalTo',
|
|
77
|
+
'notEqualTo',
|
|
78
|
+
'distinctFrom',
|
|
79
|
+
'notDistinctFrom',
|
|
80
|
+
'lessThan',
|
|
81
|
+
'lessThanOrEqualTo',
|
|
82
|
+
'greaterThan',
|
|
83
|
+
'greaterThanOrEqualTo',
|
|
84
|
+
'in',
|
|
85
|
+
'notIn',
|
|
86
|
+
'like',
|
|
87
|
+
'notLike',
|
|
88
|
+
'likeInsensitive',
|
|
89
|
+
'notLikeInsensitive',
|
|
90
|
+
'includes',
|
|
91
|
+
'notIncludes',
|
|
92
|
+
'includesInsensitive',
|
|
93
|
+
'startsWith',
|
|
94
|
+
'endsWith',
|
|
95
|
+
'isNull'
|
|
96
|
+
]);
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Where filter keyed by camelCase field names. A bare value means `equalTo`
|
|
100
|
+
* (`null` means `isNull`). Extra string keys are physical column names —
|
|
101
|
+
* runtime-configured scope key columns qualify rows the same way any other
|
|
102
|
+
* condition does.
|
|
103
|
+
*/
|
|
104
|
+
export type Where<App> = {
|
|
105
|
+
[K in keyof App]?: App[K] | FieldOps<NonNullable<App[K]>>;
|
|
106
|
+
} & {
|
|
107
|
+
[column: string]: unknown;
|
|
108
|
+
} & {
|
|
109
|
+
and?: Where<App>[];
|
|
110
|
+
or?: Where<App>[];
|
|
111
|
+
not?: Where<App>;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Write data keyed by camelCase field names. Extra string keys are physical
|
|
116
|
+
* column names — runtime-configured scope key columns are stamped the same
|
|
117
|
+
* way any other value is.
|
|
118
|
+
*/
|
|
119
|
+
export type Data<App> = Partial<App> & { [column: string]: unknown };
|
|
120
|
+
|
|
121
|
+
export type OrderDirection = 'ASC' | 'DESC';
|
|
122
|
+
|
|
123
|
+
/** Order spec keyed by camelCase field names, e.g. `{ createdAt: 'DESC' }`. */
|
|
124
|
+
export type OrderBy<App> = { [K in keyof App]?: OrderDirection };
|
|
125
|
+
|
|
126
|
+
export interface FindManyArgs<App, S extends SelectShape<App> | undefined> {
|
|
127
|
+
where?: Where<App>;
|
|
128
|
+
select?: S;
|
|
129
|
+
orderBy?: OrderBy<App> | OrderBy<App>[];
|
|
130
|
+
limit?: number;
|
|
131
|
+
offset?: number;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface FindFirstArgs<App, S extends SelectShape<App> | undefined> {
|
|
135
|
+
where?: Where<App>;
|
|
136
|
+
select?: S;
|
|
137
|
+
orderBy?: OrderBy<App> | OrderBy<App>[];
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface CreateArgs<App, S extends SelectShape<App> | undefined> {
|
|
141
|
+
data: Data<App>;
|
|
142
|
+
select?: S;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export interface UpdateArgs<App, S extends SelectShape<App> | undefined> {
|
|
146
|
+
where: Where<App>;
|
|
147
|
+
data: Data<App>;
|
|
148
|
+
select?: S;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export interface DeleteArgs<App, S extends SelectShape<App> | undefined> {
|
|
152
|
+
where: Where<App>;
|
|
153
|
+
select?: S;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** Thrown by `findFirstOrThrow` / `updateOrThrow` when no row matches. */
|
|
157
|
+
export class RowNotFoundError extends Error {
|
|
158
|
+
constructor(
|
|
159
|
+
public readonly table: string,
|
|
160
|
+
public readonly operation: string
|
|
161
|
+
) {
|
|
162
|
+
super(`${table}.${operation}: no row matched the given where filter`);
|
|
163
|
+
this.name = 'RowNotFoundError';
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const encodeScalar = (value: unknown): SqlValue => {
|
|
168
|
+
if (value === null) return null;
|
|
169
|
+
if (value instanceof Date) return value.toISOString();
|
|
170
|
+
if (typeof value === 'object' && !Array.isArray(value)) return JSON.stringify(value);
|
|
171
|
+
return value as SqlValue;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
export class TableClient<App> {
|
|
175
|
+
constructor(
|
|
176
|
+
private readonly spec: TableSpec<App>,
|
|
177
|
+
private readonly db: Queryable
|
|
178
|
+
) {}
|
|
179
|
+
|
|
180
|
+
async findMany<S extends SelectShape<App> | undefined = undefined>(
|
|
181
|
+
args: FindManyArgs<App, S> = {}
|
|
182
|
+
): Promise<SelectResult<App, S>[]> {
|
|
183
|
+
const fields = this.selectedFields(args.select);
|
|
184
|
+
const query = this.baseQuery().select(fields.map(field => this.column(field)));
|
|
185
|
+
if (args.where) query.where(this.filter(args.where));
|
|
186
|
+
this.applyOrderBy(query, args.orderBy);
|
|
187
|
+
if (args.limit !== undefined) query.limit(args.limit);
|
|
188
|
+
if (args.offset !== undefined) query.offset(args.offset);
|
|
189
|
+
const { text, values } = query.build();
|
|
190
|
+
const { rows } = await this.db.query(text, values);
|
|
191
|
+
return rows.map(row => this.decodeRow(row, fields));
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
async findFirst<S extends SelectShape<App> | undefined = undefined>(
|
|
195
|
+
args: FindFirstArgs<App, S> = {}
|
|
196
|
+
): Promise<SelectResult<App, S> | null> {
|
|
197
|
+
const rows = await this.findMany({ ...args, limit: 1 });
|
|
198
|
+
return rows.length > 0 ? rows[0] : null;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
async findFirstOrThrow<S extends SelectShape<App> | undefined = undefined>(
|
|
202
|
+
args: FindFirstArgs<App, S> = {}
|
|
203
|
+
): Promise<SelectResult<App, S>> {
|
|
204
|
+
const row = await this.findFirst(args);
|
|
205
|
+
if (row === null) throw new RowNotFoundError(this.spec.table, 'findFirstOrThrow');
|
|
206
|
+
return row;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
async count(where?: Where<App>): Promise<number> {
|
|
210
|
+
const query = this.baseQuery().select([]).selectExpr('count', fn('count', [lit(1)]));
|
|
211
|
+
if (where) query.where(this.filter(where));
|
|
212
|
+
const { text, values } = query.build();
|
|
213
|
+
const { rows } = await this.db.query(text, values);
|
|
214
|
+
const row = rows[0] as { count: string | number };
|
|
215
|
+
return Number(row.count);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
async create<S extends SelectShape<App> | undefined = undefined>(
|
|
219
|
+
args: CreateArgs<App, S>
|
|
220
|
+
): Promise<SelectResult<App, S>> {
|
|
221
|
+
const fields = this.selectedFields(args.select);
|
|
222
|
+
const query = this.baseQuery()
|
|
223
|
+
.insert(this.encodeData(args.data))
|
|
224
|
+
.returning(fields.map(field => this.column(field)));
|
|
225
|
+
const { text, values } = query.build();
|
|
226
|
+
const { rows } = await this.db.query(text, values);
|
|
227
|
+
return this.decodeRow(rows[0], fields);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
async update<S extends SelectShape<App> | undefined = undefined>(
|
|
231
|
+
args: UpdateArgs<App, S>
|
|
232
|
+
): Promise<SelectResult<App, S>[]> {
|
|
233
|
+
const fields = this.selectedFields(args.select);
|
|
234
|
+
const query = this.baseQuery()
|
|
235
|
+
.update(this.encodeData(args.data))
|
|
236
|
+
.where(this.filter(args.where))
|
|
237
|
+
.returning(fields.map(field => this.column(field)));
|
|
238
|
+
const { text, values } = query.build();
|
|
239
|
+
const { rows } = await this.db.query(text, values);
|
|
240
|
+
return rows.map(row => this.decodeRow(row, fields));
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
async updateOrThrow<S extends SelectShape<App> | undefined = undefined>(
|
|
244
|
+
args: UpdateArgs<App, S>
|
|
245
|
+
): Promise<SelectResult<App, S>> {
|
|
246
|
+
const rows = await this.update(args);
|
|
247
|
+
if (rows.length === 0) throw new RowNotFoundError(this.spec.table, 'updateOrThrow');
|
|
248
|
+
return rows[0];
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
async delete<S extends SelectShape<App> | undefined = undefined>(
|
|
252
|
+
args: DeleteArgs<App, S>
|
|
253
|
+
): Promise<SelectResult<App, S>[]> {
|
|
254
|
+
const fields = this.selectedFields(args.select);
|
|
255
|
+
const query = this.baseQuery()
|
|
256
|
+
.delete()
|
|
257
|
+
.where(this.filter(args.where))
|
|
258
|
+
.returning(fields.map(field => this.column(field)));
|
|
259
|
+
const { text, values } = query.build();
|
|
260
|
+
const { rows } = await this.db.query(text, values);
|
|
261
|
+
return rows.map(row => this.decodeRow(row, fields));
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/** Rebind to another connection (e.g. a transaction's PoolClient). */
|
|
265
|
+
$with(db: Queryable): TableClient<App> {
|
|
266
|
+
return new TableClient(this.spec, db);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
private baseQuery(): QueryBuilder {
|
|
270
|
+
return new QueryBuilder().schema(this.spec.schema).table(this.spec.table);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
private column(field: string): string {
|
|
274
|
+
return this.spec.columnByField[field] ?? field;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
private selectedFields(select: SelectShape<App> | undefined): (keyof App & string)[] {
|
|
278
|
+
const all = Object.keys(this.spec.columnByField) as (keyof App & string)[];
|
|
279
|
+
if (!select) return all;
|
|
280
|
+
const picked = all.filter(field => select[field] === true);
|
|
281
|
+
return picked.length > 0 ? picked : all;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
private decodeRow<S extends SelectShape<App> | undefined>(
|
|
285
|
+
row: unknown,
|
|
286
|
+
fields: (keyof App & string)[]
|
|
287
|
+
): SelectResult<App, S> {
|
|
288
|
+
const raw = row as Record<string, unknown>;
|
|
289
|
+
const decoded: Record<string, unknown> = {};
|
|
290
|
+
for (const field of fields) {
|
|
291
|
+
decoded[field] = this.spec.fields[field](raw[this.column(field)]);
|
|
292
|
+
}
|
|
293
|
+
return decoded as SelectResult<App, S>;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
private filter(where: Where<App>): Filter {
|
|
297
|
+
const filter: Filter = {};
|
|
298
|
+
for (const [key, value] of Object.entries(where)) {
|
|
299
|
+
if (value === undefined) continue;
|
|
300
|
+
if (key === 'and' || key === 'or') {
|
|
301
|
+
filter[key] = (value as Where<App>[]).map(nested => this.filter(nested));
|
|
302
|
+
continue;
|
|
303
|
+
}
|
|
304
|
+
if (key === 'not') {
|
|
305
|
+
filter.not = this.filter(value as Where<App>);
|
|
306
|
+
continue;
|
|
307
|
+
}
|
|
308
|
+
filter[this.column(key)] = this.fieldFilter(value);
|
|
309
|
+
}
|
|
310
|
+
return filter;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
private fieldFilter(value: unknown): Filter[string] {
|
|
314
|
+
if (value === null) return { isNull: true };
|
|
315
|
+
if (typeof value === 'object' && !Array.isArray(value) && !(value instanceof Date)) {
|
|
316
|
+
const entries = Object.entries(value as Record<string, unknown>);
|
|
317
|
+
if (entries.length > 0 && entries.every(([op]) => FIELD_OP_NAMES.has(op))) {
|
|
318
|
+
const ops: Record<string, unknown> = {};
|
|
319
|
+
for (const [op, operand] of entries) {
|
|
320
|
+
if (operand === undefined) continue;
|
|
321
|
+
ops[op] = Array.isArray(operand)
|
|
322
|
+
? operand.map(encodeScalar)
|
|
323
|
+
: op === 'isNull'
|
|
324
|
+
? operand
|
|
325
|
+
: encodeScalar(operand);
|
|
326
|
+
}
|
|
327
|
+
return ops as Filter[string];
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
return { equalTo: encodeScalar(value) };
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
private applyOrderBy(query: QueryBuilder, orderBy: OrderBy<App> | OrderBy<App>[] | undefined): void {
|
|
334
|
+
if (!orderBy) return;
|
|
335
|
+
for (const spec of Array.isArray(orderBy) ? orderBy : [orderBy]) {
|
|
336
|
+
for (const [field, direction] of Object.entries(spec)) {
|
|
337
|
+
if (!direction) continue;
|
|
338
|
+
query.orderBy(this.column(field), direction as OrderDirection);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
private encodeData(data: Data<App>): Record<string, SqlValue> {
|
|
344
|
+
const encoded: Record<string, SqlValue> = {};
|
|
345
|
+
for (const [field, value] of Object.entries(data)) {
|
|
346
|
+
if (value === undefined) continue;
|
|
347
|
+
if (value !== null && this.spec.jsonFields?.includes(field)) {
|
|
348
|
+
encoded[this.column(field)] = JSON.stringify(value);
|
|
349
|
+
continue;
|
|
350
|
+
}
|
|
351
|
+
// pg serializes JS arrays into PostgreSQL array literals.
|
|
352
|
+
encoded[this.column(field)] = Array.isArray(value)
|
|
353
|
+
? (value.map(encodeScalar) as unknown as SqlValue)
|
|
354
|
+
: encodeScalar(value);
|
|
355
|
+
}
|
|
356
|
+
return encoded;
|
|
357
|
+
}
|
|
358
|
+
}
|
package/esm/generate.js
CHANGED
|
@@ -6,6 +6,7 @@ import { promises as fs } from 'fs';
|
|
|
6
6
|
import { introspect } from 'introspectron';
|
|
7
7
|
import path from 'path';
|
|
8
8
|
import { emitRootIndex, emitSchemaIndex, tableFileName } from './emit/barrel';
|
|
9
|
+
import { emitClientRuntime, emitSchemaDbModule } from './emit/client';
|
|
9
10
|
import { emitEnumsModule } from './emit/enums';
|
|
10
11
|
import { emitRecordModule } from './emit/record';
|
|
11
12
|
import { buildIr } from './ir';
|
|
@@ -19,8 +20,10 @@ export const emitFileTree = (ir) => {
|
|
|
19
20
|
for (const table of schema.tables) {
|
|
20
21
|
files[`${schema.name}/${tableFileName(table.name)}.ts`] = emitRecordModule(table);
|
|
21
22
|
}
|
|
23
|
+
files[`${schema.name}/db.ts`] = emitSchemaDbModule(schema);
|
|
22
24
|
files[`${schema.name}/index.ts`] = emitSchemaIndex(schema);
|
|
23
25
|
}
|
|
26
|
+
files['client.ts'] = emitClientRuntime();
|
|
24
27
|
files['index.ts'] = emitRootIndex(ir.schemas);
|
|
25
28
|
return files;
|
|
26
29
|
};
|
package/generate.js
CHANGED
|
@@ -12,6 +12,7 @@ const fs_1 = require("fs");
|
|
|
12
12
|
const introspectron_1 = require("introspectron");
|
|
13
13
|
const path_1 = __importDefault(require("path"));
|
|
14
14
|
const barrel_1 = require("./emit/barrel");
|
|
15
|
+
const client_1 = require("./emit/client");
|
|
15
16
|
const enums_1 = require("./emit/enums");
|
|
16
17
|
const record_1 = require("./emit/record");
|
|
17
18
|
const ir_1 = require("./ir");
|
|
@@ -25,8 +26,10 @@ const emitFileTree = (ir) => {
|
|
|
25
26
|
for (const table of schema.tables) {
|
|
26
27
|
files[`${schema.name}/${(0, barrel_1.tableFileName)(table.name)}.ts`] = (0, record_1.emitRecordModule)(table);
|
|
27
28
|
}
|
|
29
|
+
files[`${schema.name}/db.ts`] = (0, client_1.emitSchemaDbModule)(schema);
|
|
28
30
|
files[`${schema.name}/index.ts`] = (0, barrel_1.emitSchemaIndex)(schema);
|
|
29
31
|
}
|
|
32
|
+
files['client.ts'] = (0, client_1.emitClientRuntime)();
|
|
30
33
|
files['index.ts'] = (0, barrel_1.emitRootIndex)(ir.schemas);
|
|
31
34
|
return files;
|
|
32
35
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pg-codegen",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.13.1",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "Type-safe TypeScript codegen from live PostgreSQL schemas: row types, coerce-backed decoders, serializers, table metadata, and enum unions",
|
|
6
6
|
"main": "index.js",
|
|
@@ -26,8 +26,9 @@
|
|
|
26
26
|
"clean": "makage clean",
|
|
27
27
|
"copy": "makage assets",
|
|
28
28
|
"prepack": "npm run build",
|
|
29
|
-
"
|
|
30
|
-
"build
|
|
29
|
+
"copy:templates": "mkdir -p dist/emit/templates dist/esm/emit/templates && cp src/emit/templates/*.ts dist/emit/templates/ && cp src/emit/templates/*.ts dist/esm/emit/templates/",
|
|
30
|
+
"build": "makage build && npm run copy:templates",
|
|
31
|
+
"build:dev": "makage build --dev && npm run copy:templates",
|
|
31
32
|
"dev": "ts-node ./src/cli.ts",
|
|
32
33
|
"lint": "eslint . --fix",
|
|
33
34
|
"test": "jest",
|
|
@@ -45,6 +46,7 @@
|
|
|
45
46
|
"@babel/generator": "^7.29.1",
|
|
46
47
|
"@babel/types": "^7.29.0",
|
|
47
48
|
"@constructive-io/coerce": "^0.3.0",
|
|
49
|
+
"@constructive-io/query-builder": "^3.10.4",
|
|
48
50
|
"inflekt": "^0.8.1",
|
|
49
51
|
"introspectron": "^5.12.0",
|
|
50
52
|
"pg": "^8.21.0",
|
|
@@ -56,5 +58,5 @@
|
|
|
56
58
|
"makage": "^0.3.0",
|
|
57
59
|
"pgsql-test": "^5.11.0"
|
|
58
60
|
},
|
|
59
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "133b685e9a4ff8af8955db9f49ec3992adb200a9"
|
|
60
62
|
}
|