pqb 0.18.32 → 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 CHANGED
@@ -5975,7 +5975,6 @@ declare class BigSerialColumn extends NumberAsStringBaseColumn {
5975
5975
  toCode(t: string): Code;
5976
5976
  }
5977
5977
 
5978
- type StringColumn = ColumnType<string, typeof Operators.text>;
5979
5978
  type TextColumnData = StringTypeData;
5980
5979
  type TextMethods = typeof stringTypeMethods;
5981
5980
  interface TextBaseColumn extends ColumnType<string, typeof Operators.text>, TextMethods {
@@ -6007,6 +6006,10 @@ declare class VarCharColumn<Limit extends number | undefined = undefined> extend
6007
6006
  dataType: "varchar";
6008
6007
  toCode(t: string): Code;
6009
6008
  }
6009
+ declare class StringColumn<Limit extends number = 255> extends VarCharColumn<Limit> {
6010
+ constructor(limit?: Limit);
6011
+ toCode(t: string): Code;
6012
+ }
6010
6013
  declare class CharColumn<Limit extends number | undefined = undefined> extends LimitedTextBaseColumn<Limit> {
6011
6014
  dataType: "char";
6012
6015
  toCode(t: string): Code;
@@ -6645,7 +6648,7 @@ type DefaultColumnTypes = TimestampHelpers & {
6645
6648
  varchar<Limit extends number | undefined = undefined>(limit?: Limit): VarCharColumn<Limit>;
6646
6649
  char<Limit extends number | undefined = undefined>(limit?: Limit): CharColumn<Limit>;
6647
6650
  text(min: number, max: number): TextColumn;
6648
- string<Limit extends number = 255>(limit?: Limit): VarCharColumn<Limit>;
6651
+ string<Limit extends number = 255>(limit?: Limit): StringColumn<Limit>;
6649
6652
  citext(min: number, max: number): CitextColumn;
6650
6653
  bytea(): ByteaColumn;
6651
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 VarCharColumn(limit);
3634
+ return new StringColumn(limit);
3620
3635
  },
3621
3636
  citext(min, max) {
3622
3637
  return new CitextColumn(min, max);
@@ -10426,6 +10441,7 @@ exports.Select = Select;
10426
10441
  exports.SerialColumn = SerialColumn;
10427
10442
  exports.SmallIntColumn = SmallIntColumn;
10428
10443
  exports.SmallSerialColumn = SmallSerialColumn;
10444
+ exports.StringColumn = StringColumn;
10429
10445
  exports.TextBaseColumn = TextBaseColumn;
10430
10446
  exports.TextColumn = TextColumn;
10431
10447
  exports.Then = Then;