rake-db 2.3.43 → 2.3.45
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 +139 -136
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -23,7 +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
|
-
enum:
|
|
26
|
+
enum(this: pqb.ColumnTypesBase, name: string): EnumColumn<string, [string, ...string[]]>;
|
|
27
27
|
};
|
|
28
28
|
declare type TableChanger = MigrationColumnTypes & TableChangeMethods;
|
|
29
29
|
declare type TableChangeData = Record<string, RakeDbAst.ChangeTableItem.Column | RakeDbAst.ChangeTableItem.Rename | Change | EmptyObject>;
|
|
@@ -58,49 +58,50 @@ declare type JoinTableOptions = {
|
|
|
58
58
|
};
|
|
59
59
|
declare type Migration = DbResult<DefaultColumnTypes> & MigrationBase;
|
|
60
60
|
declare const createMigrationInterface: (tx: TransactionAdapter, up: boolean, options: RakeDbConfig, adapterOptions: AdapterOptions, appCodeUpdaterCache: object) => pqb.Db<string, Record<string, never>, pqb.RelationsBase, {
|
|
61
|
+
name: typeof pqb.name;
|
|
61
62
|
raw: (sql: string, values?: false | Record<string, unknown> | undefined) => pqb.RawExpression<pqb.ColumnTypeBase<unknown, pqb.BaseOperators, unknown, pqb.ColumnDataBase>>;
|
|
62
|
-
smallint:
|
|
63
|
-
integer:
|
|
64
|
-
bigint:
|
|
65
|
-
numeric
|
|
66
|
-
decimal
|
|
67
|
-
real:
|
|
68
|
-
doublePrecision:
|
|
69
|
-
smallSerial:
|
|
70
|
-
serial:
|
|
71
|
-
bigSerial:
|
|
72
|
-
money:
|
|
73
|
-
varchar
|
|
74
|
-
char
|
|
75
|
-
text: (min: number, max: number) => TextColumn;
|
|
76
|
-
string: (min: number, max: number) => TextColumn;
|
|
77
|
-
bytea:
|
|
78
|
-
date:
|
|
79
|
-
timestamp
|
|
80
|
-
timestampWithTimeZone
|
|
81
|
-
time
|
|
82
|
-
timeWithTimeZone
|
|
83
|
-
interval
|
|
84
|
-
boolean:
|
|
85
|
-
enum
|
|
86
|
-
point:
|
|
87
|
-
line:
|
|
88
|
-
lseg:
|
|
89
|
-
box:
|
|
90
|
-
path:
|
|
91
|
-
polygon:
|
|
92
|
-
circle:
|
|
93
|
-
cidr:
|
|
94
|
-
inet:
|
|
95
|
-
macaddr:
|
|
96
|
-
macaddr8:
|
|
97
|
-
bit
|
|
98
|
-
bitVarying
|
|
99
|
-
tsvector:
|
|
100
|
-
tsquery:
|
|
101
|
-
uuid:
|
|
102
|
-
xml:
|
|
103
|
-
json
|
|
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,49 +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: {
|
|
158
|
+
name: typeof pqb.name;
|
|
157
159
|
raw: (sql: string, values?: false | Record<string, unknown> | undefined) => pqb.RawExpression<pqb.ColumnTypeBase<unknown, pqb.BaseOperators, unknown, pqb.ColumnDataBase>>;
|
|
158
|
-
smallint:
|
|
159
|
-
integer:
|
|
160
|
-
bigint:
|
|
161
|
-
numeric
|
|
162
|
-
decimal
|
|
163
|
-
real:
|
|
164
|
-
doublePrecision:
|
|
165
|
-
smallSerial:
|
|
166
|
-
serial:
|
|
167
|
-
bigSerial:
|
|
168
|
-
money:
|
|
169
|
-
varchar
|
|
170
|
-
char
|
|
171
|
-
text: (min: number, max: number) => TextColumn;
|
|
172
|
-
string: (min: number, max: number) => TextColumn;
|
|
173
|
-
bytea:
|
|
174
|
-
date:
|
|
175
|
-
timestamp
|
|
176
|
-
timestampWithTimeZone
|
|
177
|
-
time
|
|
178
|
-
timeWithTimeZone
|
|
179
|
-
interval
|
|
180
|
-
boolean:
|
|
181
|
-
enum
|
|
182
|
-
point:
|
|
183
|
-
line:
|
|
184
|
-
lseg:
|
|
185
|
-
box:
|
|
186
|
-
path:
|
|
187
|
-
polygon:
|
|
188
|
-
circle:
|
|
189
|
-
cidr:
|
|
190
|
-
inet:
|
|
191
|
-
macaddr:
|
|
192
|
-
macaddr8:
|
|
193
|
-
bit
|
|
194
|
-
bitVarying
|
|
195
|
-
tsvector:
|
|
196
|
-
tsquery:
|
|
197
|
-
uuid:
|
|
198
|
-
xml:
|
|
199
|
-
json
|
|
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: {
|
|
200
202
|
set: <Value extends pqb.JSONTypeAny>(valueType: Value) => pqb.JSONSet<Value>;
|
|
201
203
|
tuple: <T_1 extends [] | pqb.JSONTupleItems, Rest extends pqb.JSONTypeAny | null = null>(items: T_1, rest?: Rest) => pqb.JSONTuple<T_1, Rest>;
|
|
202
204
|
union: <T_2 extends [pqb.JSONTypeAny, pqb.JSONTypeAny, ...pqb.JSONTypeAny[]]>(types: T_2) => pqb.JSONUnion<T_2>;
|
|
@@ -230,9 +232,9 @@ declare const createMigrationInterface: (tx: TransactionAdapter, up: boolean, op
|
|
|
230
232
|
})[k_2]; } : never>;
|
|
231
233
|
optional: <T_13 extends pqb.JSONTypeAny>(type: T_13) => pqb.JSONOptional<T_13>;
|
|
232
234
|
record: typeof pqb.record;
|
|
233
|
-
}) => Type))
|
|
234
|
-
jsonText:
|
|
235
|
-
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>;
|
|
236
238
|
timestamps: <T_14 extends ColumnType<unknown, pqb.BaseOperators, unknown>>(this: {
|
|
237
239
|
timestamp(): T_14;
|
|
238
240
|
}) => {
|
|
@@ -249,49 +251,50 @@ declare const createMigrationInterface: (tx: TransactionAdapter, up: boolean, op
|
|
|
249
251
|
<Table_1 extends string, Columns_1 extends [string, ...string[]]>(columns: string[], table: Table_1, foreignColumns: Columns_1, options?: ForeignKeyOptions | undefined): {};
|
|
250
252
|
};
|
|
251
253
|
}) => Shape) | undefined, options?: pqb.DbTableOptions | undefined): pqb.Db<Table_2, Shape, pqb.RelationsBase, {
|
|
254
|
+
name: typeof pqb.name;
|
|
252
255
|
raw: (sql: string, values?: false | Record<string, unknown> | undefined) => pqb.RawExpression<pqb.ColumnTypeBase<unknown, pqb.BaseOperators, unknown, pqb.ColumnDataBase>>;
|
|
253
|
-
smallint:
|
|
254
|
-
integer:
|
|
255
|
-
bigint:
|
|
256
|
-
numeric
|
|
257
|
-
decimal
|
|
258
|
-
real:
|
|
259
|
-
doublePrecision:
|
|
260
|
-
smallSerial:
|
|
261
|
-
serial:
|
|
262
|
-
bigSerial:
|
|
263
|
-
money:
|
|
264
|
-
varchar
|
|
265
|
-
char
|
|
266
|
-
text: (min: number, max: number) => TextColumn;
|
|
267
|
-
string: (min: number, max: number) => TextColumn;
|
|
268
|
-
bytea:
|
|
269
|
-
date:
|
|
270
|
-
timestamp
|
|
271
|
-
timestampWithTimeZone
|
|
272
|
-
time
|
|
273
|
-
timeWithTimeZone
|
|
274
|
-
interval
|
|
275
|
-
boolean:
|
|
276
|
-
enum
|
|
277
|
-
point:
|
|
278
|
-
line:
|
|
279
|
-
lseg:
|
|
280
|
-
box:
|
|
281
|
-
path:
|
|
282
|
-
polygon:
|
|
283
|
-
circle:
|
|
284
|
-
cidr:
|
|
285
|
-
inet:
|
|
286
|
-
macaddr:
|
|
287
|
-
macaddr8:
|
|
288
|
-
bit
|
|
289
|
-
bitVarying
|
|
290
|
-
tsvector:
|
|
291
|
-
tsquery:
|
|
292
|
-
uuid:
|
|
293
|
-
xml:
|
|
294
|
-
json
|
|
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: {
|
|
295
298
|
set: <Value extends pqb.JSONTypeAny>(valueType: Value) => pqb.JSONSet<Value>;
|
|
296
299
|
tuple: <T_1 extends [] | pqb.JSONTupleItems, Rest extends pqb.JSONTypeAny | null = null>(items: T_1, rest?: Rest) => pqb.JSONTuple<T_1, Rest>;
|
|
297
300
|
union: <T_2 extends [pqb.JSONTypeAny, pqb.JSONTypeAny, ...pqb.JSONTypeAny[]]>(types: T_2) => pqb.JSONUnion<T_2>;
|
|
@@ -325,9 +328,9 @@ declare const createMigrationInterface: (tx: TransactionAdapter, up: boolean, op
|
|
|
325
328
|
})[k_2]; } : never>;
|
|
326
329
|
optional: <T_13 extends pqb.JSONTypeAny>(type: T_13) => pqb.JSONOptional<T_13>;
|
|
327
330
|
record: typeof pqb.record;
|
|
328
|
-
}) => Type))
|
|
329
|
-
jsonText:
|
|
330
|
-
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>;
|
|
331
334
|
timestamps: <T_14 extends ColumnType<unknown, pqb.BaseOperators, unknown>>(this: {
|
|
332
335
|
timestamp(): T_14;
|
|
333
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,7 +465,9 @@ const primaryKeyToSql = (primaryKey) => {
|
|
|
463
465
|
};
|
|
464
466
|
|
|
465
467
|
const tableMethods = {
|
|
466
|
-
enum
|
|
468
|
+
enum(name) {
|
|
469
|
+
return new pqb.EnumColumn(this, name, []);
|
|
470
|
+
}
|
|
467
471
|
};
|
|
468
472
|
|
|
469
473
|
class RakeDbError extends Error {
|
|
@@ -1316,7 +1320,13 @@ const processMigration = async (db, up, file, config, options, appCodeUpdaterCac
|
|
|
1316
1320
|
clearChanges();
|
|
1317
1321
|
let changes = changeCache[file.path];
|
|
1318
1322
|
if (!changes) {
|
|
1319
|
-
|
|
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
|
+
}
|
|
1320
1330
|
changes = getCurrentChanges();
|
|
1321
1331
|
changeCache[file.path] = changes;
|
|
1322
1332
|
}
|