pqb 0.67.6 → 0.67.7
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 +501 -219
- package/dist/index.js +12 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -11
- package/dist/index.mjs.map +1 -1
- package/dist/internal.d.ts +497 -223
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2036,8 +2036,8 @@ var IntervalColumn = class extends Column {
|
|
|
2036
2036
|
}
|
|
2037
2037
|
};
|
|
2038
2038
|
var ArrayColumn = class ArrayColumn extends Column {
|
|
2039
|
-
constructor(schema, item,
|
|
2040
|
-
super(schema,
|
|
2039
|
+
constructor(schema, item, __inputType, defaultEncode, __outputType, __queryType) {
|
|
2040
|
+
super(schema, __inputType, __outputType, __queryType);
|
|
2041
2041
|
this.dataType = "array";
|
|
2042
2042
|
this.operators = Operators.array;
|
|
2043
2043
|
item.data.isNullable = true;
|
|
@@ -2117,8 +2117,8 @@ const parsePostgresArray = (source, entries, transform) => {
|
|
|
2117
2117
|
};
|
|
2118
2118
|
const encodeJson = (x) => x === null ? x : JSON.stringify(x);
|
|
2119
2119
|
var JSONColumn = class extends Column {
|
|
2120
|
-
constructor(schema,
|
|
2121
|
-
super(schema,
|
|
2120
|
+
constructor(schema, __inputType, encodedByDriver = true) {
|
|
2121
|
+
super(schema, __inputType);
|
|
2122
2122
|
this.dataType = "jsonb";
|
|
2123
2123
|
this.operators = Operators.json;
|
|
2124
2124
|
if (!encodedByDriver) this.data.encode = encodeJson;
|
|
@@ -2130,10 +2130,10 @@ var JSONColumn = class extends Column {
|
|
|
2130
2130
|
};
|
|
2131
2131
|
var JSONTextColumn = class JSONTextColumn extends Column {
|
|
2132
2132
|
static get instance() {
|
|
2133
|
-
return this._instance ??= new JSONTextColumn(internalSchemaConfig);
|
|
2133
|
+
return this._instance ??= new JSONTextColumn(internalSchemaConfig, void 0);
|
|
2134
2134
|
}
|
|
2135
|
-
constructor(schema) {
|
|
2136
|
-
super(schema,
|
|
2135
|
+
constructor(schema, __inputType) {
|
|
2136
|
+
super(schema, __inputType);
|
|
2137
2137
|
this.dataType = "json";
|
|
2138
2138
|
this.operators = Operators.text;
|
|
2139
2139
|
}
|
|
@@ -2344,6 +2344,9 @@ const defaultSchemaConfig = (options) => {
|
|
|
2344
2344
|
json() {
|
|
2345
2345
|
return new JSONColumn(schemaConfig, void 0, options?.jsonEncodedByDriver);
|
|
2346
2346
|
},
|
|
2347
|
+
jsonText() {
|
|
2348
|
+
return new JSONTextColumn(schemaConfig, void 0);
|
|
2349
|
+
},
|
|
2347
2350
|
setErrors: noop,
|
|
2348
2351
|
smallint: () => new SmallIntColumn(schemaConfig),
|
|
2349
2352
|
integer: () => new IntegerColumn(schemaConfig),
|
|
@@ -2972,9 +2975,7 @@ const makeColumnTypes = (schema) => {
|
|
|
2972
2975
|
return new XMLColumn(schema);
|
|
2973
2976
|
},
|
|
2974
2977
|
json: schema.json,
|
|
2975
|
-
jsonText
|
|
2976
|
-
return new JSONTextColumn(schema);
|
|
2977
|
-
},
|
|
2978
|
+
jsonText: schema.jsonText,
|
|
2978
2979
|
type(dataType) {
|
|
2979
2980
|
return new CustomTypeColumn(schema, dataType);
|
|
2980
2981
|
},
|
|
@@ -11122,7 +11123,7 @@ const getShapeFromSelect = (q, isSubQuery) => {
|
|
|
11122
11123
|
if (returnType === "value" || returnType === "valueOrThrow") {
|
|
11123
11124
|
const type = it.q.getColumn;
|
|
11124
11125
|
result[key] = type ? mapSubSelectColumn(type, isSubQuery) : UnknownColumn.instance;
|
|
11125
|
-
} else result[key] = new JSONTextColumn(internalSchemaConfig);
|
|
11126
|
+
} else result[key] = new JSONTextColumn(internalSchemaConfig, void 0);
|
|
11126
11127
|
}
|
|
11127
11128
|
}
|
|
11128
11129
|
}
|