rake-db 2.3.42 → 2.3.44
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 +142 -137
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -23,8 +23,7 @@ declare const tableChangeMethods: {
|
|
|
23
23
|
nonNullable(): Change;
|
|
24
24
|
comment(comment: string | null): Change;
|
|
25
25
|
rename(name: string): RakeDbAst.ChangeTableItem.Rename;
|
|
26
|
-
|
|
27
|
-
enum: (name: string) => EnumColumn<string, [string, ...string[]]>;
|
|
26
|
+
enum(this: pqb.ColumnTypesBase, name: string): EnumColumn<string, [string, ...string[]]>;
|
|
28
27
|
};
|
|
29
28
|
declare type TableChanger = MigrationColumnTypes & TableChangeMethods;
|
|
30
29
|
declare type TableChangeData = Record<string, RakeDbAst.ChangeTableItem.Column | RakeDbAst.ChangeTableItem.Rename | Change | EmptyObject>;
|
|
@@ -59,48 +58,50 @@ declare type JoinTableOptions = {
|
|
|
59
58
|
};
|
|
60
59
|
declare type Migration = DbResult<DefaultColumnTypes> & MigrationBase;
|
|
61
60
|
declare const createMigrationInterface: (tx: TransactionAdapter, up: boolean, options: RakeDbConfig, adapterOptions: AdapterOptions, appCodeUpdaterCache: object) => pqb.Db<string, Record<string, never>, pqb.RelationsBase, {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
61
|
+
name: typeof pqb.name;
|
|
62
|
+
raw: (sql: string, values?: false | Record<string, unknown> | undefined) => pqb.RawExpression<pqb.ColumnTypeBase<unknown, pqb.BaseOperators, unknown, pqb.ColumnDataBase>>;
|
|
63
|
+
smallint(this: pqb.ColumnTypesBase): pqb.SmallIntColumn;
|
|
64
|
+
integer(this: pqb.ColumnTypesBase): pqb.IntegerColumn;
|
|
65
|
+
bigint(this: pqb.ColumnTypesBase): pqb.BigIntColumn;
|
|
66
|
+
numeric<Precision extends number | undefined = undefined, Scale extends number | undefined = undefined>(this: pqb.ColumnTypesBase, precision?: Precision | undefined, scale?: Scale | undefined): pqb.DecimalColumn<Precision, Scale>;
|
|
67
|
+
decimal<Precision_1 extends number | undefined = undefined, Scale_1 extends number | undefined = undefined>(this: pqb.ColumnTypesBase, precision?: Precision_1 | undefined, scale?: Scale_1 | undefined): pqb.DecimalColumn<Precision_1, Scale_1>;
|
|
68
|
+
real(this: pqb.ColumnTypesBase): pqb.RealColumn;
|
|
69
|
+
doublePrecision(this: pqb.ColumnTypesBase): pqb.DoublePrecisionColumn;
|
|
70
|
+
smallSerial(this: pqb.ColumnTypesBase): pqb.SmallSerialColumn;
|
|
71
|
+
serial(this: pqb.ColumnTypesBase): pqb.SerialColumn;
|
|
72
|
+
bigSerial(this: pqb.ColumnTypesBase): pqb.BigSerialColumn;
|
|
73
|
+
money(this: pqb.ColumnTypesBase): pqb.MoneyColumn;
|
|
74
|
+
varchar<Limit extends number | undefined = undefined>(this: pqb.ColumnTypesBase, limit?: Limit | undefined): pqb.VarCharColumn<Limit>;
|
|
75
|
+
char<Limit_1 extends number | undefined = undefined>(this: pqb.ColumnTypesBase, limit?: Limit_1 | undefined): pqb.CharColumn<Limit_1>;
|
|
76
|
+
text: (this: pqb.ColumnTypesBase, min: number, max: number) => TextColumn;
|
|
77
|
+
string: (this: pqb.ColumnTypesBase, min: number, max: number) => TextColumn;
|
|
78
|
+
bytea(this: pqb.ColumnTypesBase): pqb.ByteaColumn;
|
|
79
|
+
date(this: pqb.ColumnTypesBase): pqb.DateColumn;
|
|
80
|
+
timestamp<Precision_2 extends number>(this: pqb.ColumnTypesBase, precision?: Precision_2 | undefined): pqb.TimestampColumn<Precision_2>;
|
|
81
|
+
timestampWithTimeZone<Precision_3 extends number | undefined = undefined>(this: pqb.ColumnTypesBase, precision?: Precision_3 | undefined): pqb.TimestampWithTimeZoneColumn<number>;
|
|
82
|
+
time<Precision_4 extends number | undefined = undefined>(this: pqb.ColumnTypesBase, precision?: Precision_4 | undefined): pqb.TimeColumn<Precision_4>;
|
|
83
|
+
timeWithTimeZone<Precision_5 extends number | undefined = undefined>(this: pqb.ColumnTypesBase, precision?: Precision_5 | undefined): pqb.TimeWithTimeZoneColumn<Precision_5>;
|
|
84
|
+
interval<Fields extends string | undefined = undefined, Precision_6 extends number | undefined = undefined>(this: pqb.ColumnTypesBase, fields?: Fields | undefined, precision?: Precision_6 | undefined): pqb.IntervalColumn<Fields, Precision_6>;
|
|
85
|
+
boolean(this: pqb.ColumnTypesBase): pqb.BooleanColumn;
|
|
86
|
+
enum<U extends string, T extends [U, ...U[]]>(this: pqb.ColumnTypesBase, dataType: string, type: T): EnumColumn<U, T>;
|
|
87
|
+
point(this: pqb.ColumnTypesBase): pqb.PointColumn;
|
|
88
|
+
line(this: pqb.ColumnTypesBase): pqb.LineColumn;
|
|
89
|
+
lseg(this: pqb.ColumnTypesBase): pqb.LsegColumn;
|
|
90
|
+
box(this: pqb.ColumnTypesBase): pqb.BoxColumn;
|
|
91
|
+
path(this: pqb.ColumnTypesBase): pqb.PathColumn;
|
|
92
|
+
polygon(this: pqb.ColumnTypesBase): pqb.PolygonColumn;
|
|
93
|
+
circle(this: pqb.ColumnTypesBase): pqb.CircleColumn;
|
|
94
|
+
cidr(this: pqb.ColumnTypesBase): pqb.CidrColumn;
|
|
95
|
+
inet(this: pqb.ColumnTypesBase): pqb.InetColumn;
|
|
96
|
+
macaddr(this: pqb.ColumnTypesBase): pqb.MacAddrColumn;
|
|
97
|
+
macaddr8(this: pqb.ColumnTypesBase): pqb.MacAddr8Column;
|
|
98
|
+
bit<Length extends number>(this: pqb.ColumnTypesBase, length: Length): pqb.BitColumn<Length>;
|
|
99
|
+
bitVarying<Length_1 extends number | undefined = undefined>(this: pqb.ColumnTypesBase, length?: Length_1 | undefined): pqb.BitVaryingColumn<Length_1>;
|
|
100
|
+
tsvector(this: pqb.ColumnTypesBase): pqb.TsVectorColumn;
|
|
101
|
+
tsquery(this: pqb.ColumnTypesBase): pqb.TsQueryColumn;
|
|
102
|
+
uuid(this: pqb.ColumnTypesBase): pqb.UUIDColumn;
|
|
103
|
+
xml(this: pqb.ColumnTypesBase): pqb.XMLColumn;
|
|
104
|
+
json<Type extends pqb.JSONTypeAny>(this: pqb.ColumnTypesBase, schemaOrFn: Type | ((j: {
|
|
104
105
|
set: <Value extends pqb.JSONTypeAny>(valueType: Value) => pqb.JSONSet<Value>;
|
|
105
106
|
tuple: <T_1 extends [] | pqb.JSONTupleItems, Rest extends pqb.JSONTypeAny | null = null>(items: T_1, rest?: Rest) => pqb.JSONTuple<T_1, Rest>;
|
|
106
107
|
union: <T_2 extends [pqb.JSONTypeAny, pqb.JSONTypeAny, ...pqb.JSONTypeAny[]]>(types: T_2) => pqb.JSONUnion<T_2>;
|
|
@@ -134,9 +135,9 @@ declare const createMigrationInterface: (tx: TransactionAdapter, up: boolean, op
|
|
|
134
135
|
})[k_2]; } : never>;
|
|
135
136
|
optional: <T_13 extends pqb.JSONTypeAny>(type: T_13) => pqb.JSONOptional<T_13>;
|
|
136
137
|
record: typeof pqb.record;
|
|
137
|
-
}) => Type))
|
|
138
|
-
jsonText:
|
|
139
|
-
array
|
|
138
|
+
}) => Type)): pqb.JSONColumn<Type>;
|
|
139
|
+
jsonText(this: pqb.ColumnTypesBase): pqb.JSONTextColumn;
|
|
140
|
+
array<Item extends ColumnType<unknown, pqb.BaseOperators, unknown>>(this: pqb.ColumnTypesBase, item: Item): pqb.ArrayColumn<Item>;
|
|
140
141
|
timestamps: <T_14 extends ColumnType<unknown, pqb.BaseOperators, unknown>>(this: {
|
|
141
142
|
timestamp(): T_14;
|
|
142
143
|
}) => {
|
|
@@ -154,48 +155,50 @@ declare const createMigrationInterface: (tx: TransactionAdapter, up: boolean, op
|
|
|
154
155
|
};
|
|
155
156
|
}> & {
|
|
156
157
|
<Table_2 extends string, Shape extends ColumnsShape = ColumnsShape>(table: Table_2, shape?: Shape | ((t: {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
158
|
+
name: typeof pqb.name;
|
|
159
|
+
raw: (sql: string, values?: false | Record<string, unknown> | undefined) => pqb.RawExpression<pqb.ColumnTypeBase<unknown, pqb.BaseOperators, unknown, pqb.ColumnDataBase>>;
|
|
160
|
+
smallint(this: pqb.ColumnTypesBase): pqb.SmallIntColumn;
|
|
161
|
+
integer(this: pqb.ColumnTypesBase): pqb.IntegerColumn;
|
|
162
|
+
bigint(this: pqb.ColumnTypesBase): pqb.BigIntColumn;
|
|
163
|
+
numeric<Precision extends number | undefined = undefined, Scale extends number | undefined = undefined>(this: pqb.ColumnTypesBase, precision?: Precision | undefined, scale?: Scale | undefined): pqb.DecimalColumn<Precision, Scale>;
|
|
164
|
+
decimal<Precision_1 extends number | undefined = undefined, Scale_1 extends number | undefined = undefined>(this: pqb.ColumnTypesBase, precision?: Precision_1 | undefined, scale?: Scale_1 | undefined): pqb.DecimalColumn<Precision_1, Scale_1>;
|
|
165
|
+
real(this: pqb.ColumnTypesBase): pqb.RealColumn;
|
|
166
|
+
doublePrecision(this: pqb.ColumnTypesBase): pqb.DoublePrecisionColumn;
|
|
167
|
+
smallSerial(this: pqb.ColumnTypesBase): pqb.SmallSerialColumn;
|
|
168
|
+
serial(this: pqb.ColumnTypesBase): pqb.SerialColumn;
|
|
169
|
+
bigSerial(this: pqb.ColumnTypesBase): pqb.BigSerialColumn;
|
|
170
|
+
money(this: pqb.ColumnTypesBase): pqb.MoneyColumn;
|
|
171
|
+
varchar<Limit extends number | undefined = undefined>(this: pqb.ColumnTypesBase, limit?: Limit | undefined): pqb.VarCharColumn<Limit>;
|
|
172
|
+
char<Limit_1 extends number | undefined = undefined>(this: pqb.ColumnTypesBase, limit?: Limit_1 | undefined): pqb.CharColumn<Limit_1>;
|
|
173
|
+
text: (this: pqb.ColumnTypesBase, min: number, max: number) => TextColumn;
|
|
174
|
+
string: (this: pqb.ColumnTypesBase, min: number, max: number) => TextColumn;
|
|
175
|
+
bytea(this: pqb.ColumnTypesBase): pqb.ByteaColumn;
|
|
176
|
+
date(this: pqb.ColumnTypesBase): pqb.DateColumn;
|
|
177
|
+
timestamp<Precision_2 extends number>(this: pqb.ColumnTypesBase, precision?: Precision_2 | undefined): pqb.TimestampColumn<Precision_2>;
|
|
178
|
+
timestampWithTimeZone<Precision_3 extends number | undefined = undefined>(this: pqb.ColumnTypesBase, precision?: Precision_3 | undefined): pqb.TimestampWithTimeZoneColumn<number>;
|
|
179
|
+
time<Precision_4 extends number | undefined = undefined>(this: pqb.ColumnTypesBase, precision?: Precision_4 | undefined): pqb.TimeColumn<Precision_4>;
|
|
180
|
+
timeWithTimeZone<Precision_5 extends number | undefined = undefined>(this: pqb.ColumnTypesBase, precision?: Precision_5 | undefined): pqb.TimeWithTimeZoneColumn<Precision_5>;
|
|
181
|
+
interval<Fields extends string | undefined = undefined, Precision_6 extends number | undefined = undefined>(this: pqb.ColumnTypesBase, fields?: Fields | undefined, precision?: Precision_6 | undefined): pqb.IntervalColumn<Fields, Precision_6>;
|
|
182
|
+
boolean(this: pqb.ColumnTypesBase): pqb.BooleanColumn;
|
|
183
|
+
enum<U extends string, T extends [U, ...U[]]>(this: pqb.ColumnTypesBase, dataType: string, type: T): EnumColumn<U, T>;
|
|
184
|
+
point(this: pqb.ColumnTypesBase): pqb.PointColumn;
|
|
185
|
+
line(this: pqb.ColumnTypesBase): pqb.LineColumn;
|
|
186
|
+
lseg(this: pqb.ColumnTypesBase): pqb.LsegColumn;
|
|
187
|
+
box(this: pqb.ColumnTypesBase): pqb.BoxColumn;
|
|
188
|
+
path(this: pqb.ColumnTypesBase): pqb.PathColumn;
|
|
189
|
+
polygon(this: pqb.ColumnTypesBase): pqb.PolygonColumn;
|
|
190
|
+
circle(this: pqb.ColumnTypesBase): pqb.CircleColumn;
|
|
191
|
+
cidr(this: pqb.ColumnTypesBase): pqb.CidrColumn;
|
|
192
|
+
inet(this: pqb.ColumnTypesBase): pqb.InetColumn;
|
|
193
|
+
macaddr(this: pqb.ColumnTypesBase): pqb.MacAddrColumn;
|
|
194
|
+
macaddr8(this: pqb.ColumnTypesBase): pqb.MacAddr8Column;
|
|
195
|
+
bit<Length extends number>(this: pqb.ColumnTypesBase, length: Length): pqb.BitColumn<Length>;
|
|
196
|
+
bitVarying<Length_1 extends number | undefined = undefined>(this: pqb.ColumnTypesBase, length?: Length_1 | undefined): pqb.BitVaryingColumn<Length_1>;
|
|
197
|
+
tsvector(this: pqb.ColumnTypesBase): pqb.TsVectorColumn;
|
|
198
|
+
tsquery(this: pqb.ColumnTypesBase): pqb.TsQueryColumn;
|
|
199
|
+
uuid(this: pqb.ColumnTypesBase): pqb.UUIDColumn;
|
|
200
|
+
xml(this: pqb.ColumnTypesBase): pqb.XMLColumn;
|
|
201
|
+
json<Type extends pqb.JSONTypeAny>(this: pqb.ColumnTypesBase, schemaOrFn: Type | ((j: {
|
|
199
202
|
set: <Value extends pqb.JSONTypeAny>(valueType: Value) => pqb.JSONSet<Value>;
|
|
200
203
|
tuple: <T_1 extends [] | pqb.JSONTupleItems, Rest extends pqb.JSONTypeAny | null = null>(items: T_1, rest?: Rest) => pqb.JSONTuple<T_1, Rest>;
|
|
201
204
|
union: <T_2 extends [pqb.JSONTypeAny, pqb.JSONTypeAny, ...pqb.JSONTypeAny[]]>(types: T_2) => pqb.JSONUnion<T_2>;
|
|
@@ -229,9 +232,9 @@ declare const createMigrationInterface: (tx: TransactionAdapter, up: boolean, op
|
|
|
229
232
|
})[k_2]; } : never>;
|
|
230
233
|
optional: <T_13 extends pqb.JSONTypeAny>(type: T_13) => pqb.JSONOptional<T_13>;
|
|
231
234
|
record: typeof pqb.record;
|
|
232
|
-
}) => Type))
|
|
233
|
-
jsonText:
|
|
234
|
-
array
|
|
235
|
+
}) => Type)): pqb.JSONColumn<Type>;
|
|
236
|
+
jsonText(this: pqb.ColumnTypesBase): pqb.JSONTextColumn;
|
|
237
|
+
array<Item extends ColumnType<unknown, pqb.BaseOperators, unknown>>(this: pqb.ColumnTypesBase, item: Item): pqb.ArrayColumn<Item>;
|
|
235
238
|
timestamps: <T_14 extends ColumnType<unknown, pqb.BaseOperators, unknown>>(this: {
|
|
236
239
|
timestamp(): T_14;
|
|
237
240
|
}) => {
|
|
@@ -248,48 +251,50 @@ declare const createMigrationInterface: (tx: TransactionAdapter, up: boolean, op
|
|
|
248
251
|
<Table_1 extends string, Columns_1 extends [string, ...string[]]>(columns: string[], table: Table_1, foreignColumns: Columns_1, options?: ForeignKeyOptions | undefined): {};
|
|
249
252
|
};
|
|
250
253
|
}) => Shape) | undefined, options?: pqb.DbTableOptions | undefined): pqb.Db<Table_2, Shape, pqb.RelationsBase, {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
254
|
+
name: typeof pqb.name;
|
|
255
|
+
raw: (sql: string, values?: false | Record<string, unknown> | undefined) => pqb.RawExpression<pqb.ColumnTypeBase<unknown, pqb.BaseOperators, unknown, pqb.ColumnDataBase>>;
|
|
256
|
+
smallint(this: pqb.ColumnTypesBase): pqb.SmallIntColumn;
|
|
257
|
+
integer(this: pqb.ColumnTypesBase): pqb.IntegerColumn;
|
|
258
|
+
bigint(this: pqb.ColumnTypesBase): pqb.BigIntColumn;
|
|
259
|
+
numeric<Precision extends number | undefined = undefined, Scale extends number | undefined = undefined>(this: pqb.ColumnTypesBase, precision?: Precision | undefined, scale?: Scale | undefined): pqb.DecimalColumn<Precision, Scale>;
|
|
260
|
+
decimal<Precision_1 extends number | undefined = undefined, Scale_1 extends number | undefined = undefined>(this: pqb.ColumnTypesBase, precision?: Precision_1 | undefined, scale?: Scale_1 | undefined): pqb.DecimalColumn<Precision_1, Scale_1>;
|
|
261
|
+
real(this: pqb.ColumnTypesBase): pqb.RealColumn;
|
|
262
|
+
doublePrecision(this: pqb.ColumnTypesBase): pqb.DoublePrecisionColumn;
|
|
263
|
+
smallSerial(this: pqb.ColumnTypesBase): pqb.SmallSerialColumn;
|
|
264
|
+
serial(this: pqb.ColumnTypesBase): pqb.SerialColumn;
|
|
265
|
+
bigSerial(this: pqb.ColumnTypesBase): pqb.BigSerialColumn;
|
|
266
|
+
money(this: pqb.ColumnTypesBase): pqb.MoneyColumn;
|
|
267
|
+
varchar<Limit extends number | undefined = undefined>(this: pqb.ColumnTypesBase, limit?: Limit | undefined): pqb.VarCharColumn<Limit>;
|
|
268
|
+
char<Limit_1 extends number | undefined = undefined>(this: pqb.ColumnTypesBase, limit?: Limit_1 | undefined): pqb.CharColumn<Limit_1>;
|
|
269
|
+
text: (this: pqb.ColumnTypesBase, min: number, max: number) => TextColumn;
|
|
270
|
+
string: (this: pqb.ColumnTypesBase, min: number, max: number) => TextColumn;
|
|
271
|
+
bytea(this: pqb.ColumnTypesBase): pqb.ByteaColumn;
|
|
272
|
+
date(this: pqb.ColumnTypesBase): pqb.DateColumn;
|
|
273
|
+
timestamp<Precision_2 extends number>(this: pqb.ColumnTypesBase, precision?: Precision_2 | undefined): pqb.TimestampColumn<Precision_2>;
|
|
274
|
+
timestampWithTimeZone<Precision_3 extends number | undefined = undefined>(this: pqb.ColumnTypesBase, precision?: Precision_3 | undefined): pqb.TimestampWithTimeZoneColumn<number>;
|
|
275
|
+
time<Precision_4 extends number | undefined = undefined>(this: pqb.ColumnTypesBase, precision?: Precision_4 | undefined): pqb.TimeColumn<Precision_4>;
|
|
276
|
+
timeWithTimeZone<Precision_5 extends number | undefined = undefined>(this: pqb.ColumnTypesBase, precision?: Precision_5 | undefined): pqb.TimeWithTimeZoneColumn<Precision_5>;
|
|
277
|
+
interval<Fields extends string | undefined = undefined, Precision_6 extends number | undefined = undefined>(this: pqb.ColumnTypesBase, fields?: Fields | undefined, precision?: Precision_6 | undefined): pqb.IntervalColumn<Fields, Precision_6>;
|
|
278
|
+
boolean(this: pqb.ColumnTypesBase): pqb.BooleanColumn;
|
|
279
|
+
enum<U extends string, T extends [U, ...U[]]>(this: pqb.ColumnTypesBase, dataType: string, type: T): EnumColumn<U, T>;
|
|
280
|
+
point(this: pqb.ColumnTypesBase): pqb.PointColumn;
|
|
281
|
+
line(this: pqb.ColumnTypesBase): pqb.LineColumn;
|
|
282
|
+
lseg(this: pqb.ColumnTypesBase): pqb.LsegColumn;
|
|
283
|
+
box(this: pqb.ColumnTypesBase): pqb.BoxColumn;
|
|
284
|
+
path(this: pqb.ColumnTypesBase): pqb.PathColumn;
|
|
285
|
+
polygon(this: pqb.ColumnTypesBase): pqb.PolygonColumn;
|
|
286
|
+
circle(this: pqb.ColumnTypesBase): pqb.CircleColumn;
|
|
287
|
+
cidr(this: pqb.ColumnTypesBase): pqb.CidrColumn;
|
|
288
|
+
inet(this: pqb.ColumnTypesBase): pqb.InetColumn;
|
|
289
|
+
macaddr(this: pqb.ColumnTypesBase): pqb.MacAddrColumn;
|
|
290
|
+
macaddr8(this: pqb.ColumnTypesBase): pqb.MacAddr8Column;
|
|
291
|
+
bit<Length extends number>(this: pqb.ColumnTypesBase, length: Length): pqb.BitColumn<Length>;
|
|
292
|
+
bitVarying<Length_1 extends number | undefined = undefined>(this: pqb.ColumnTypesBase, length?: Length_1 | undefined): pqb.BitVaryingColumn<Length_1>;
|
|
293
|
+
tsvector(this: pqb.ColumnTypesBase): pqb.TsVectorColumn;
|
|
294
|
+
tsquery(this: pqb.ColumnTypesBase): pqb.TsQueryColumn;
|
|
295
|
+
uuid(this: pqb.ColumnTypesBase): pqb.UUIDColumn;
|
|
296
|
+
xml(this: pqb.ColumnTypesBase): pqb.XMLColumn;
|
|
297
|
+
json<Type extends pqb.JSONTypeAny>(this: pqb.ColumnTypesBase, schemaOrFn: Type | ((j: {
|
|
293
298
|
set: <Value extends pqb.JSONTypeAny>(valueType: Value) => pqb.JSONSet<Value>;
|
|
294
299
|
tuple: <T_1 extends [] | pqb.JSONTupleItems, Rest extends pqb.JSONTypeAny | null = null>(items: T_1, rest?: Rest) => pqb.JSONTuple<T_1, Rest>;
|
|
295
300
|
union: <T_2 extends [pqb.JSONTypeAny, pqb.JSONTypeAny, ...pqb.JSONTypeAny[]]>(types: T_2) => pqb.JSONUnion<T_2>;
|
|
@@ -323,9 +328,9 @@ declare const createMigrationInterface: (tx: TransactionAdapter, up: boolean, op
|
|
|
323
328
|
})[k_2]; } : never>;
|
|
324
329
|
optional: <T_13 extends pqb.JSONTypeAny>(type: T_13) => pqb.JSONOptional<T_13>;
|
|
325
330
|
record: typeof pqb.record;
|
|
326
|
-
}) => Type))
|
|
327
|
-
jsonText:
|
|
328
|
-
array
|
|
331
|
+
}) => Type)): pqb.JSONColumn<Type>;
|
|
332
|
+
jsonText(this: pqb.ColumnTypesBase): pqb.JSONTextColumn;
|
|
333
|
+
array<Item extends ColumnType<unknown, pqb.BaseOperators, unknown>>(this: pqb.ColumnTypesBase, item: Item): pqb.ArrayColumn<Item>;
|
|
329
334
|
timestamps: <T_14 extends ColumnType<unknown, pqb.BaseOperators, unknown>>(this: {
|
|
330
335
|
timestamp(): T_14;
|
|
331
336
|
}) => {
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ var pqb = require('pqb');
|
|
|
6
6
|
var path = require('path');
|
|
7
7
|
var promises = require('fs/promises');
|
|
8
8
|
var prompts = require('prompts');
|
|
9
|
+
var url = require('url');
|
|
9
10
|
|
|
10
11
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
12
|
|
|
@@ -29,6 +30,7 @@ function _interopNamespace(e) {
|
|
|
29
30
|
|
|
30
31
|
var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
|
|
31
32
|
var prompts__default = /*#__PURE__*/_interopDefaultLegacy(prompts);
|
|
33
|
+
var url__namespace = /*#__PURE__*/_interopNamespace(url);
|
|
32
34
|
|
|
33
35
|
var __defProp$6 = Object.defineProperty;
|
|
34
36
|
var __defProps$5 = Object.defineProperties;
|
|
@@ -463,8 +465,9 @@ const primaryKeyToSql = (primaryKey) => {
|
|
|
463
465
|
};
|
|
464
466
|
|
|
465
467
|
const tableMethods = {
|
|
466
|
-
|
|
467
|
-
|
|
468
|
+
enum(name) {
|
|
469
|
+
return new pqb.EnumColumn(this, name, []);
|
|
470
|
+
}
|
|
468
471
|
};
|
|
469
472
|
|
|
470
473
|
class RakeDbError extends Error {
|
|
@@ -1317,7 +1320,13 @@ const processMigration = async (db, up, file, config, options, appCodeUpdaterCac
|
|
|
1317
1320
|
clearChanges();
|
|
1318
1321
|
let changes = changeCache[file.path];
|
|
1319
1322
|
if (!changes) {
|
|
1320
|
-
|
|
1323
|
+
try {
|
|
1324
|
+
await config.import(file.path);
|
|
1325
|
+
} catch (err) {
|
|
1326
|
+
if (err.code === "ERR_UNSUPPORTED_ESM_URL_SCHEME")
|
|
1327
|
+
throw err;
|
|
1328
|
+
await config.import(url__namespace.pathToFileURL(file.path).pathname);
|
|
1329
|
+
}
|
|
1321
1330
|
changes = getCurrentChanges();
|
|
1322
1331
|
changeCache[file.path] = changes;
|
|
1323
1332
|
}
|