pqb 0.33.2 → 0.34.0
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 +10 -16
- package/dist/index.js +10 -50
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -50
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1236,17 +1236,11 @@ class TextBaseColumn extends ColumnType {
|
|
|
1236
1236
|
}
|
|
1237
1237
|
class LimitedTextBaseColumn extends TextBaseColumn {
|
|
1238
1238
|
constructor(schema, limit) {
|
|
1239
|
-
super(
|
|
1240
|
-
schema,
|
|
1241
|
-
limit ? schema.stringMax(limit) : schema.stringSchema()
|
|
1242
|
-
);
|
|
1239
|
+
super(schema, schema.stringMax(limit));
|
|
1243
1240
|
this.data.maxChars = limit;
|
|
1244
1241
|
}
|
|
1245
1242
|
toSQL() {
|
|
1246
|
-
return joinTruthy(
|
|
1247
|
-
this.dataType,
|
|
1248
|
-
this.data.maxChars !== void 0 && `(${this.data.maxChars})`
|
|
1249
|
-
);
|
|
1243
|
+
return joinTruthy(this.dataType, `(${this.data.maxChars})`);
|
|
1250
1244
|
}
|
|
1251
1245
|
}
|
|
1252
1246
|
class VarCharColumn extends LimitedTextBaseColumn {
|
|
@@ -1280,29 +1274,6 @@ class StringColumn extends VarCharColumn {
|
|
|
1280
1274
|
);
|
|
1281
1275
|
}
|
|
1282
1276
|
}
|
|
1283
|
-
class CharColumn extends LimitedTextBaseColumn {
|
|
1284
|
-
constructor() {
|
|
1285
|
-
super(...arguments);
|
|
1286
|
-
this.dataType = "char";
|
|
1287
|
-
}
|
|
1288
|
-
toCode(t, m) {
|
|
1289
|
-
const { maxChars } = this.data;
|
|
1290
|
-
return columnCode(
|
|
1291
|
-
this,
|
|
1292
|
-
t,
|
|
1293
|
-
`char(${maxChars != null ? maxChars : ""})${stringDataToCode(this.data, m)}`,
|
|
1294
|
-
m
|
|
1295
|
-
);
|
|
1296
|
-
}
|
|
1297
|
-
}
|
|
1298
|
-
const setTextColumnData = (column, minArg, maxArg) => {
|
|
1299
|
-
if (minArg !== void 0) {
|
|
1300
|
-
column.data.min = column.data.minArg = minArg;
|
|
1301
|
-
if (maxArg !== void 0) {
|
|
1302
|
-
column.data.max = column.data.maxArg = maxArg;
|
|
1303
|
-
}
|
|
1304
|
-
}
|
|
1305
|
-
};
|
|
1306
1277
|
const textColumnToCode = (column, t, m) => {
|
|
1307
1278
|
const data = __spreadValues$e({}, column.data);
|
|
1308
1279
|
let args = "";
|
|
@@ -1326,12 +1297,10 @@ const textColumnToCode = (column, t, m) => {
|
|
|
1326
1297
|
m
|
|
1327
1298
|
);
|
|
1328
1299
|
};
|
|
1329
|
-
const minMaxToSchema = (schema, min, max) => min ? max ? schema.stringMinMax(min, max) : schema.stringMin(min) : schema.stringSchema();
|
|
1330
1300
|
class TextColumn extends TextBaseColumn {
|
|
1331
|
-
constructor(schema
|
|
1332
|
-
super(schema,
|
|
1301
|
+
constructor(schema) {
|
|
1302
|
+
super(schema, schema.stringSchema());
|
|
1333
1303
|
this.dataType = "text";
|
|
1334
|
-
setTextColumnData(this, min, max);
|
|
1335
1304
|
}
|
|
1336
1305
|
toCode(t, m) {
|
|
1337
1306
|
return textColumnToCode(this, t, m);
|
|
@@ -1618,10 +1587,9 @@ class XMLColumn extends ColumnType {
|
|
|
1618
1587
|
}
|
|
1619
1588
|
}
|
|
1620
1589
|
class CitextColumn extends TextBaseColumn {
|
|
1621
|
-
constructor(schema
|
|
1622
|
-
super(schema,
|
|
1590
|
+
constructor(schema) {
|
|
1591
|
+
super(schema, schema.stringSchema());
|
|
1623
1592
|
this.dataType = "citext";
|
|
1624
|
-
setTextColumnData(this, min, max);
|
|
1625
1593
|
}
|
|
1626
1594
|
toCode(t, m) {
|
|
1627
1595
|
return textColumnToCode(this, t, m);
|
|
@@ -3045,10 +3013,9 @@ const defaultSchemaConfig = {
|
|
|
3045
3013
|
bigSerial: () => new BigSerialColumn(defaultSchemaConfig),
|
|
3046
3014
|
money: () => new MoneyColumn(defaultSchemaConfig),
|
|
3047
3015
|
varchar: (limit) => new VarCharColumn(defaultSchemaConfig, limit),
|
|
3048
|
-
|
|
3049
|
-
text: (min, max) => new TextColumn(defaultSchemaConfig, min, max),
|
|
3016
|
+
text: () => new TextColumn(defaultSchemaConfig),
|
|
3050
3017
|
string: (limit) => new StringColumn(defaultSchemaConfig, limit),
|
|
3051
|
-
citext: (
|
|
3018
|
+
citext: () => new CitextColumn(defaultSchemaConfig),
|
|
3052
3019
|
date: () => new DateColumn(defaultSchemaConfig),
|
|
3053
3020
|
timestampNoTZ: (precision) => new TimestampColumn(defaultSchemaConfig, precision),
|
|
3054
3021
|
timestamp: (precision) => new TimestampTZColumn(defaultSchemaConfig, precision)
|
|
@@ -5308,7 +5275,6 @@ const makeColumnTypes = (schema) => {
|
|
|
5308
5275
|
bigSerial: schema.bigSerial,
|
|
5309
5276
|
money: schema.money,
|
|
5310
5277
|
varchar: schema.varchar,
|
|
5311
|
-
char: schema.char,
|
|
5312
5278
|
text: schema.text,
|
|
5313
5279
|
string: schema.string,
|
|
5314
5280
|
citext: schema.citext,
|
|
@@ -5416,16 +5382,13 @@ const makeColumnsByType = (schema) => {
|
|
|
5416
5382
|
bool: t.boolean,
|
|
5417
5383
|
boolean: t.boolean,
|
|
5418
5384
|
bytea: t.bytea,
|
|
5419
|
-
char: t.char,
|
|
5420
5385
|
int8: t.bigint,
|
|
5421
5386
|
bigint: t.bigint,
|
|
5422
5387
|
int2: t.smallint,
|
|
5423
5388
|
smallint: t.smallint,
|
|
5424
5389
|
int4: t.integer,
|
|
5425
5390
|
integer: t.integer,
|
|
5426
|
-
text
|
|
5427
|
-
return t.text(0, Infinity);
|
|
5428
|
-
},
|
|
5391
|
+
text: t.text,
|
|
5429
5392
|
json: t.jsonText,
|
|
5430
5393
|
xml: t.xml,
|
|
5431
5394
|
point: t.point,
|
|
@@ -5444,8 +5407,6 @@ const makeColumnsByType = (schema) => {
|
|
|
5444
5407
|
money: t.money,
|
|
5445
5408
|
macaddr: t.macaddr,
|
|
5446
5409
|
inet: t.inet,
|
|
5447
|
-
bpchar: t.char,
|
|
5448
|
-
character: t.char,
|
|
5449
5410
|
varchar: t.varchar,
|
|
5450
5411
|
"character varying": t.varchar,
|
|
5451
5412
|
date: t.date,
|
|
@@ -9107,7 +9068,7 @@ class Where {
|
|
|
9107
9068
|
*
|
|
9108
9069
|
* ### Text column operators
|
|
9109
9070
|
*
|
|
9110
|
-
* For `text`, `
|
|
9071
|
+
* For `text`, `varchar`, `string`, and `json` columns.
|
|
9111
9072
|
*
|
|
9112
9073
|
* `json` is stored as text, so it has text operators. Use the `jsonb` type for JSON operators.
|
|
9113
9074
|
*
|
|
@@ -12042,5 +12003,5 @@ function copyTableData(query, arg) {
|
|
|
12042
12003
|
return q;
|
|
12043
12004
|
}
|
|
12044
12005
|
|
|
12045
|
-
export { Adapter, AggregateMethods, ArrayColumn, AsMethods, BigIntColumn, BigSerialColumn, BitColumn, BitVaryingColumn, BooleanColumn, BoxColumn, ByteaColumn,
|
|
12006
|
+
export { Adapter, AggregateMethods, ArrayColumn, AsMethods, BigIntColumn, BigSerialColumn, BitColumn, BitVaryingColumn, BooleanColumn, BoxColumn, ByteaColumn, CidrColumn, CircleColumn, CitextColumn, Clear, ColumnRefExpression, ColumnType, Create, CustomTypeColumn, DateBaseColumn, DateColumn, DateTimeBaseClass, DateTimeTzBaseClass, Db, DecimalColumn, Delete, DomainColumn, DoublePrecisionColumn, DynamicRawSQL, EnumColumn, ExpressionMethods, FnExpression, For, FromMethods, Having, InetColumn, IntegerBaseColumn, IntegerColumn, IntervalColumn, JSONColumn, JSONTextColumn, Join, JsonMethods, LimitedTextBaseColumn, LineColumn, LsegColumn, MacAddr8Column, MacAddrColumn, MergeQueryMethods, MoneyColumn, MoreThanOneRowError, NotFoundError, NumberAsStringBaseColumn, NumberBaseColumn, OnConflictQueryBuilder, OnMethods, Operators, OrExpression, OrchidOrmError, OrchidOrmInternalError, PathColumn, PointColumn, PolygonColumn, QueryBase, QueryError, QueryGet, QueryHooks, QueryLog, QueryMethods, QueryUpsertOrCreate, RawSQL, RealColumn, RefExpression, SearchMethods, Select, SerialColumn, SmallIntColumn, SmallSerialColumn, SqlMethod, StringColumn, TextBaseColumn, TextColumn, Then, TimeColumn, TimestampColumn, TimestampTZColumn, Transaction, TransactionAdapter, TransformMethods, TsQueryColumn, TsVectorColumn, UUIDColumn, UnhandledTypeError, Union, UnknownColumn, Update, VarCharColumn, VirtualColumn, Where, WithMethods, XMLColumn, _initQueryBuilder, _queryAfterSaveCommit, _queryAll, _queryAs, _queryChangeCounter, _queryCreate, _queryCreateFrom, _queryCreateMany, _queryCreateManyFrom, _queryCreateManyRaw, _queryCreateRaw, _queryDefaults, _queryDelete, _queryExec, _queryFindBy, _queryFindByOptional, _queryGet, _queryGetOptional, _queryHookAfterCreate, _queryHookAfterCreateCommit, _queryHookAfterDelete, _queryHookAfterDeleteCommit, _queryHookAfterQuery, _queryHookAfterSave, _queryHookAfterUpdate, _queryHookAfterUpdateCommit, _queryHookBeforeCreate, _queryHookBeforeDelete, _queryHookBeforeQuery, _queryHookBeforeSave, _queryHookBeforeUpdate, _queryInsert, _queryInsertFrom, _queryInsertMany, _queryInsertManyFrom, _queryInsertManyRaw, _queryInsertRaw, _queryJoinOn, _queryJoinOnJsonPathEquals, _queryJoinOrOn, _queryOr, _queryOrNot, _queryRows, _querySelect, _queryTake, _queryTakeOptional, _queryUnion, _queryUpdate, _queryUpdateOrThrow, _queryUpdateRaw, _queryWhere, _queryWhereExists, _queryWhereIn, _queryWhereNot, _queryWhereNotSql, _queryWhereSql, addComputedColumns, addParserForRawExpression, addParserForSelectItem, addQueryOn, anyShape, checkIfASimpleQuery, cloneQuery, cloneQueryBaseUnscoped, columnCheckToCode, columnCode, columnForeignKeysToCode, columnIndexesToCode, columnsShapeToCode, commitSql$1 as commitSql, constraintInnerToCode, constraintToCode, copyTableData, countSelect, createDb, defaultSchemaConfig, extendQuery, foreignKeyArgumentToCode, getClonedQueryData, getColumnInfo, getColumnTypes, getPrimaryKeys, getQueryAs, getShapeFromSelect, getSqlText, handleResult, identityToCode, indexInnerToCode, indexToCode, instantiateColumn, isDefaultTimeStamp, isQueryReturnsAll, isSelectingCount, joinSubQuery, logColors, logParamToLogObject, makeColumnTypes, makeColumnsByType, makeFnExpression, makeRegexToFindInSql, makeSQL, parseRecord, parseResult, parseTableData, parseTableDataInput, primaryKeyInnerToCode, processSelectArg, pushLimitSQL, pushQueryArray, pushQueryOn, pushQueryOrOn, pushQueryValue, pushTableDataCode, queryFrom, queryFromSql, queryJson, queryMethodByReturnType, queryTypeWithLimitOne, queryWrap, quote, quoteString, raw, referencesArgsToCode, resolveSubQueryCallback, rollbackSql$1 as rollbackSql, saveSearchAlias, setParserForSelectedString, setQueryObjectValue, setQueryOperators, simplifyColumnDefault, sqlFn, sqlQueryArgsToExpression, tableDataMethods, templateLiteralToSQL, testTransaction, throwIfNoWhere, toSQL, toSQLCacheKey };
|
|
12046
12007
|
//# sourceMappingURL=index.mjs.map
|