pqb 0.7.2 → 0.7.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # pqb
2
2
 
3
+ ## 0.7.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Add required min and max parameters to text column
8
+
3
9
  ## 0.7.2
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -4318,8 +4318,28 @@ declare const columnTypes: {
4318
4318
  money: () => MoneyColumn;
4319
4319
  varchar: <Limit extends number | undefined = undefined>(limit?: Limit | undefined) => VarCharColumn<Limit>;
4320
4320
  char: <Limit_1 extends number | undefined = undefined>(limit?: Limit_1 | undefined) => CharColumn<Limit_1>;
4321
- text: () => TextColumn;
4322
- string: () => TextColumn;
4321
+ text: (min: number, max: number) => Omit<Omit<TextColumn, "data"> & {
4322
+ data: Omit<BaseStringData, "min"> & {
4323
+ min: number;
4324
+ };
4325
+ }, "data"> & {
4326
+ data: Omit<Omit<BaseStringData, "min"> & {
4327
+ min: number;
4328
+ }, "max"> & {
4329
+ max: number;
4330
+ };
4331
+ };
4332
+ string: (min: number, max: number) => Omit<Omit<TextColumn, "data"> & {
4333
+ data: Omit<BaseStringData, "min"> & {
4334
+ min: number;
4335
+ };
4336
+ }, "data"> & {
4337
+ data: Omit<Omit<BaseStringData, "min"> & {
4338
+ min: number;
4339
+ }, "max"> & {
4340
+ max: number;
4341
+ };
4342
+ };
4323
4343
  bytea: () => ByteaColumn;
4324
4344
  date: () => DateColumn;
4325
4345
  timestamp: <Precision_2 extends number | undefined = undefined>(precision?: Precision_2 | undefined) => TimestampColumn<Precision_2>;
package/dist/index.esm.js CHANGED
@@ -307,7 +307,7 @@ const numeric = () => __spreadProps$j(__spreadValues$p({}, base()), {
307
307
  gte: all.gte(),
308
308
  between: all.between()
309
309
  });
310
- const text = () => __spreadProps$j(__spreadValues$p({}, base()), {
310
+ const text$1 = () => __spreadProps$j(__spreadValues$p({}, base()), {
311
311
  contains: all.contains(),
312
312
  containsInsensitive: all.containsInsensitive(),
313
313
  startsWith: all.startsWith(),
@@ -326,7 +326,7 @@ const Operators = {
326
326
  number: numeric(),
327
327
  date: numeric(),
328
328
  time: numeric(),
329
- text: text(),
329
+ text: text$1(),
330
330
  json: json(),
331
331
  array: base()
332
332
  };
@@ -3067,6 +3067,7 @@ const getColumnTypes = (types, fn, data = newTableData()) => {
3067
3067
  resetTableData(data);
3068
3068
  return fn(types);
3069
3069
  };
3070
+ const text = (min, max) => new TextColumn().min(min).max(max);
3070
3071
  const columnTypes = {
3071
3072
  smallint: () => new SmallIntColumn(),
3072
3073
  integer: () => new IntegerColumn(),
@@ -3081,8 +3082,8 @@ const columnTypes = {
3081
3082
  money: () => new MoneyColumn(),
3082
3083
  varchar: (limit) => new VarCharColumn(limit),
3083
3084
  char: (limit) => new CharColumn(limit),
3084
- text: () => new TextColumn(),
3085
- string: () => new TextColumn(),
3085
+ text,
3086
+ string: text,
3086
3087
  bytea: () => new ByteaColumn(),
3087
3088
  date: () => new DateColumn(),
3088
3089
  timestamp: (precision) => new TimestampColumn(precision),