pqb 0.18.31 → 0.18.33
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 -2
- package/dist/index.js +25 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1753,8 +1753,13 @@ type DeleteResult<T extends Query> = T['meta']['hasSelect'] extends true ? SetQu
|
|
|
1753
1753
|
declare class Delete {
|
|
1754
1754
|
/**
|
|
1755
1755
|
* Alias for `delete` method
|
|
1756
|
+
*
|
|
1757
|
+
* @deprecated use `delete` instead, this method will be removed
|
|
1756
1758
|
*/
|
|
1757
1759
|
del<T extends Query>(this: T, ..._args: DeleteArgs<T>): DeleteResult<T>;
|
|
1760
|
+
/**
|
|
1761
|
+
* @deprecated use `_del` instead, this method will be removed
|
|
1762
|
+
*/
|
|
1758
1763
|
_del<T extends Query>(this: T, ..._args: DeleteArgs<T>): DeleteResult<T>;
|
|
1759
1764
|
/**
|
|
1760
1765
|
* It is aliased to `del` because `delete` is a reserved word in JavaScript.
|
|
@@ -5970,7 +5975,6 @@ declare class BigSerialColumn extends NumberAsStringBaseColumn {
|
|
|
5970
5975
|
toCode(t: string): Code;
|
|
5971
5976
|
}
|
|
5972
5977
|
|
|
5973
|
-
type StringColumn = ColumnType<string, typeof Operators.text>;
|
|
5974
5978
|
type TextColumnData = StringTypeData;
|
|
5975
5979
|
type TextMethods = typeof stringTypeMethods;
|
|
5976
5980
|
interface TextBaseColumn extends ColumnType<string, typeof Operators.text>, TextMethods {
|
|
@@ -6002,6 +6006,10 @@ declare class VarCharColumn<Limit extends number | undefined = undefined> extend
|
|
|
6002
6006
|
dataType: "varchar";
|
|
6003
6007
|
toCode(t: string): Code;
|
|
6004
6008
|
}
|
|
6009
|
+
declare class StringColumn<Limit extends number = 255> extends VarCharColumn<Limit> {
|
|
6010
|
+
constructor(limit?: Limit);
|
|
6011
|
+
toCode(t: string): Code;
|
|
6012
|
+
}
|
|
6005
6013
|
declare class CharColumn<Limit extends number | undefined = undefined> extends LimitedTextBaseColumn<Limit> {
|
|
6006
6014
|
dataType: "char";
|
|
6007
6015
|
toCode(t: string): Code;
|
|
@@ -6640,7 +6648,7 @@ type DefaultColumnTypes = TimestampHelpers & {
|
|
|
6640
6648
|
varchar<Limit extends number | undefined = undefined>(limit?: Limit): VarCharColumn<Limit>;
|
|
6641
6649
|
char<Limit extends number | undefined = undefined>(limit?: Limit): CharColumn<Limit>;
|
|
6642
6650
|
text(min: number, max: number): TextColumn;
|
|
6643
|
-
string<Limit extends number = 255>(limit?: Limit):
|
|
6651
|
+
string<Limit extends number = 255>(limit?: Limit): StringColumn<Limit>;
|
|
6644
6652
|
citext(min: number, max: number): CitextColumn;
|
|
6645
6653
|
bytea(): ByteaColumn;
|
|
6646
6654
|
date(): DateColumn;
|
package/dist/index.js
CHANGED
|
@@ -2859,6 +2859,21 @@ class VarCharColumn extends LimitedTextBaseColumn {
|
|
|
2859
2859
|
);
|
|
2860
2860
|
}
|
|
2861
2861
|
}
|
|
2862
|
+
class StringColumn extends VarCharColumn {
|
|
2863
|
+
constructor(limit = 255) {
|
|
2864
|
+
super(limit);
|
|
2865
|
+
}
|
|
2866
|
+
toCode(t) {
|
|
2867
|
+
let max = this.data.maxChars;
|
|
2868
|
+
if (max === 255)
|
|
2869
|
+
max = void 0;
|
|
2870
|
+
return columnCode(
|
|
2871
|
+
this,
|
|
2872
|
+
t,
|
|
2873
|
+
`string(${max != null ? max : ""})${orchidCore.stringDataToCode(this.data)}`
|
|
2874
|
+
);
|
|
2875
|
+
}
|
|
2876
|
+
}
|
|
2862
2877
|
class CharColumn extends LimitedTextBaseColumn {
|
|
2863
2878
|
constructor() {
|
|
2864
2879
|
super(...arguments);
|
|
@@ -3616,7 +3631,7 @@ const columnTypes = __spreadValues$9({
|
|
|
3616
3631
|
return new TextColumn(min, max);
|
|
3617
3632
|
},
|
|
3618
3633
|
string(limit = 255) {
|
|
3619
|
-
return new
|
|
3634
|
+
return new StringColumn(limit);
|
|
3620
3635
|
},
|
|
3621
3636
|
citext(min, max) {
|
|
3622
3637
|
return new CitextColumn(min, max);
|
|
@@ -5577,6 +5592,9 @@ const del = (self) => {
|
|
|
5577
5592
|
};
|
|
5578
5593
|
const _del = (q) => {
|
|
5579
5594
|
if (!q.q.select) {
|
|
5595
|
+
if (q.q.returnType === "oneOrThrow" || q.q.returnType === "valueOrThrow") {
|
|
5596
|
+
q.q.throwOnNotFound = true;
|
|
5597
|
+
}
|
|
5580
5598
|
q.q.returnType = "rowCount";
|
|
5581
5599
|
}
|
|
5582
5600
|
throwIfNoWhere(q, "delete");
|
|
@@ -5586,12 +5604,15 @@ const _del = (q) => {
|
|
|
5586
5604
|
class Delete {
|
|
5587
5605
|
/**
|
|
5588
5606
|
* Alias for `delete` method
|
|
5607
|
+
*
|
|
5608
|
+
* @deprecated use `delete` instead, this method will be removed
|
|
5589
5609
|
*/
|
|
5590
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5591
5610
|
del(..._args) {
|
|
5592
5611
|
return del(this);
|
|
5593
5612
|
}
|
|
5594
|
-
|
|
5613
|
+
/**
|
|
5614
|
+
* @deprecated use `_del` instead, this method will be removed
|
|
5615
|
+
*/
|
|
5595
5616
|
_del(..._args) {
|
|
5596
5617
|
return _del(this);
|
|
5597
5618
|
}
|
|
@@ -10420,6 +10441,7 @@ exports.Select = Select;
|
|
|
10420
10441
|
exports.SerialColumn = SerialColumn;
|
|
10421
10442
|
exports.SmallIntColumn = SmallIntColumn;
|
|
10422
10443
|
exports.SmallSerialColumn = SmallSerialColumn;
|
|
10444
|
+
exports.StringColumn = StringColumn;
|
|
10423
10445
|
exports.TextBaseColumn = TextBaseColumn;
|
|
10424
10446
|
exports.TextColumn = TextColumn;
|
|
10425
10447
|
exports.Then = Then;
|