hysteria-orm 10.9.1 → 10.9.2

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/lib/index.d.cts CHANGED
@@ -988,6 +988,8 @@ declare class ColumnTypeNode extends QueryNode {
988
988
  autoCreate?: boolean;
989
989
  autoUpdate?: boolean;
990
990
  collate?: string;
991
+ unsigned?: boolean;
992
+ zerofill?: boolean;
991
993
  chainsWith: string;
992
994
  canKeywordBeSeenMultipleTimes: boolean;
993
995
  folder: string;
@@ -1004,6 +1006,8 @@ declare class ColumnTypeNode extends QueryNode {
1004
1006
  autoUpdate?: boolean;
1005
1007
  collate?: string;
1006
1008
  isRawValue?: boolean;
1009
+ unsigned?: boolean;
1010
+ zerofill?: boolean;
1007
1011
  });
1008
1012
  }
1009
1013
 
@@ -1029,6 +1033,19 @@ declare class ConstraintBuilder extends BaseBuilder {
1029
1033
  * @description Sets the column to auto increment
1030
1034
  */
1031
1035
  increment(): this;
1036
+ /**
1037
+ * @description Sets the column to UNSIGNED (MySQL/MariaDB only)
1038
+ * Restricts the column to non-negative values.
1039
+ * @mysql Only supported by MySQL/MariaDB. Other databases silently ignore this.
1040
+ */
1041
+ unsigned(): this;
1042
+ /**
1043
+ * @description Sets the column to ZEROFILL (MySQL/MariaDB only)
1044
+ * Pads the column value with zeros up to the display width.
1045
+ * Note: ZEROFILL implicitly makes the column UNSIGNED.
1046
+ * @mysql Only supported by MySQL/MariaDB. Other databases silently ignore this.
1047
+ */
1048
+ zerofill(): this;
1032
1049
  /**
1033
1050
  * @description Sets the column to not nullable
1034
1051
  */
@@ -1843,10 +1860,11 @@ declare class InterpreterUtils {
1843
1860
  */
1844
1861
  declare class WriteOperation<T> implements PromiseLike<T> {
1845
1862
  private unWrapFn;
1863
+ private toSqlFn;
1846
1864
  private toQueryFn;
1847
1865
  private executor;
1848
1866
  readonly [Symbol.toStringTag] = "WriteOperation";
1849
- constructor(unWrapFn: () => ReturnType<typeof AstParser.prototype.parse>, toQueryFn: () => string, executor: () => Promise<T>);
1867
+ constructor(unWrapFn: () => ReturnType<typeof AstParser.prototype.parse>, toSqlFn: () => ReturnType<typeof AstParser.prototype.parse>, toQueryFn: () => string, executor: () => Promise<T>);
1850
1868
  then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
1851
1869
  catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null | undefined): Promise<T | TResult>;
1852
1870
  finally(onfinally?: (() => void) | null | undefined): Promise<T>;
@@ -1856,7 +1874,13 @@ declare class WriteOperation<T> implements PromiseLike<T> {
1856
1874
  */
1857
1875
  toQuery(): string;
1858
1876
  /**
1859
- * @description Returns the query with database driver placeholders and the params
1877
+ * @description Returns the formatted query with database driver placeholders and the params
1878
+ * @description Use this for debugging purposes to see the formatted SQL
1879
+ * @warning Does not apply any hook from the model
1880
+ */
1881
+ toSql(): ReturnType<typeof AstParser.prototype.parse>;
1882
+ /**
1883
+ * @description Returns the raw query with database driver placeholders and the params
1860
1884
  * @warning Does not apply any hook from the model
1861
1885
  */
1862
1886
  unWrap(): ReturnType<typeof AstParser.prototype.parse>;
@@ -2854,6 +2878,8 @@ type ColumnType = {
2854
2878
  precision?: number;
2855
2879
  scale?: number;
2856
2880
  withTimezone?: boolean;
2881
+ unsigned?: boolean;
2882
+ zerofill?: boolean;
2857
2883
  constraints?: {
2858
2884
  nullable?: boolean;
2859
2885
  default?: string | number | null | boolean;
@@ -4197,7 +4223,14 @@ declare class QueryBuilder<T extends Model = any, S extends Record<string, any>
4197
4223
  */
4198
4224
  toQuery(): string;
4199
4225
  /**
4200
- * @description Returns the query with database driver placeholders and the params
4226
+ * @description Returns the formatted query with database driver placeholders and the params
4227
+ * @description Use this for debugging purposes to see the formatted SQL
4228
+ * @warning Does not apply any hook from the model
4229
+ * @warning Does not show any `load` operations in the query, it only shows the operations that directly belong to the query builder instance
4230
+ */
4231
+ toSql(): ReturnType<typeof AstParser.prototype.parse>;
4232
+ /**
4233
+ * @description Returns the raw query with database driver placeholders and the params
4201
4234
  * @description To be used for executing the query with the database driver
4202
4235
  * @warning Does not apply any hook from the model
4203
4236
  * @warning Does not show any `load` operations in the query, it only shows the operations that directly belong to the query builder instance
@@ -4284,6 +4317,8 @@ type TableColumnInfo = {
4284
4317
  scale?: number | null;
4285
4318
  withTimezone?: boolean | null;
4286
4319
  enumValues?: string[] | null;
4320
+ unsigned?: boolean | null;
4321
+ zerofill?: boolean | null;
4287
4322
  };
4288
4323
  type TableIndexInfo = {
4289
4324
  name: string;
@@ -6307,12 +6342,23 @@ type ColStringOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "
6307
6342
  length?: number;
6308
6343
  };
6309
6344
  type ColTextOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "default">;
6310
- type ColIntegerOptions = Omit<ColumnOptions, "serialize" | "prepare" | "default">;
6311
- type ColBigIntegerOptions = Omit<ColumnOptions, "serialize" | "prepare" | "default">;
6312
- type ColFloatOptions = Omit<ColumnOptions, "serialize" | "prepare" | "default">;
6345
+ type ColIntegerOptions = Omit<ColumnOptions, "serialize" | "prepare" | "default"> & {
6346
+ unsigned?: boolean;
6347
+ zerofill?: boolean;
6348
+ };
6349
+ type ColBigIntegerOptions = Omit<ColumnOptions, "serialize" | "prepare" | "default"> & {
6350
+ unsigned?: boolean;
6351
+ zerofill?: boolean;
6352
+ };
6353
+ type ColFloatOptions = Omit<ColumnOptions, "serialize" | "prepare" | "default"> & {
6354
+ unsigned?: boolean;
6355
+ zerofill?: boolean;
6356
+ };
6313
6357
  type ColDecimalOptions = Omit<ColumnOptions, "serialize" | "prepare" | "default"> & {
6314
6358
  precision?: number;
6315
6359
  scale?: number;
6360
+ unsigned?: boolean;
6361
+ zerofill?: boolean;
6316
6362
  };
6317
6363
  type ColIncrementOptions = Omit<ColumnOptions, "serialize" | "prepare" | "primaryKey" | "nullable" | "default">;
6318
6364
  type ColBigIncrementOptions = Omit<ColumnOptions, "serialize" | "prepare" | "primaryKey" | "nullable" | "default">;
@@ -6335,9 +6381,18 @@ type ColCharOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "de
6335
6381
  type ColVarbinaryOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "default"> & {
6336
6382
  length?: number;
6337
6383
  };
6338
- type ColTinyIntOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "default">;
6339
- type ColSmallIntOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "default">;
6340
- type ColMediumIntOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "default">;
6384
+ type ColTinyIntOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "default"> & {
6385
+ unsigned?: boolean;
6386
+ zerofill?: boolean;
6387
+ };
6388
+ type ColSmallIntOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "default"> & {
6389
+ unsigned?: boolean;
6390
+ zerofill?: boolean;
6391
+ };
6392
+ type ColMediumIntOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "default"> & {
6393
+ unsigned?: boolean;
6394
+ zerofill?: boolean;
6395
+ };
6341
6396
  type RelationConstraintOptions = {
6342
6397
  /**
6343
6398
  * Useful for auto generated migrations to specify the on delete action, it does not affect the code wise implementation
package/lib/index.d.ts CHANGED
@@ -988,6 +988,8 @@ declare class ColumnTypeNode extends QueryNode {
988
988
  autoCreate?: boolean;
989
989
  autoUpdate?: boolean;
990
990
  collate?: string;
991
+ unsigned?: boolean;
992
+ zerofill?: boolean;
991
993
  chainsWith: string;
992
994
  canKeywordBeSeenMultipleTimes: boolean;
993
995
  folder: string;
@@ -1004,6 +1006,8 @@ declare class ColumnTypeNode extends QueryNode {
1004
1006
  autoUpdate?: boolean;
1005
1007
  collate?: string;
1006
1008
  isRawValue?: boolean;
1009
+ unsigned?: boolean;
1010
+ zerofill?: boolean;
1007
1011
  });
1008
1012
  }
1009
1013
 
@@ -1029,6 +1033,19 @@ declare class ConstraintBuilder extends BaseBuilder {
1029
1033
  * @description Sets the column to auto increment
1030
1034
  */
1031
1035
  increment(): this;
1036
+ /**
1037
+ * @description Sets the column to UNSIGNED (MySQL/MariaDB only)
1038
+ * Restricts the column to non-negative values.
1039
+ * @mysql Only supported by MySQL/MariaDB. Other databases silently ignore this.
1040
+ */
1041
+ unsigned(): this;
1042
+ /**
1043
+ * @description Sets the column to ZEROFILL (MySQL/MariaDB only)
1044
+ * Pads the column value with zeros up to the display width.
1045
+ * Note: ZEROFILL implicitly makes the column UNSIGNED.
1046
+ * @mysql Only supported by MySQL/MariaDB. Other databases silently ignore this.
1047
+ */
1048
+ zerofill(): this;
1032
1049
  /**
1033
1050
  * @description Sets the column to not nullable
1034
1051
  */
@@ -1843,10 +1860,11 @@ declare class InterpreterUtils {
1843
1860
  */
1844
1861
  declare class WriteOperation<T> implements PromiseLike<T> {
1845
1862
  private unWrapFn;
1863
+ private toSqlFn;
1846
1864
  private toQueryFn;
1847
1865
  private executor;
1848
1866
  readonly [Symbol.toStringTag] = "WriteOperation";
1849
- constructor(unWrapFn: () => ReturnType<typeof AstParser.prototype.parse>, toQueryFn: () => string, executor: () => Promise<T>);
1867
+ constructor(unWrapFn: () => ReturnType<typeof AstParser.prototype.parse>, toSqlFn: () => ReturnType<typeof AstParser.prototype.parse>, toQueryFn: () => string, executor: () => Promise<T>);
1850
1868
  then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
1851
1869
  catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null | undefined): Promise<T | TResult>;
1852
1870
  finally(onfinally?: (() => void) | null | undefined): Promise<T>;
@@ -1856,7 +1874,13 @@ declare class WriteOperation<T> implements PromiseLike<T> {
1856
1874
  */
1857
1875
  toQuery(): string;
1858
1876
  /**
1859
- * @description Returns the query with database driver placeholders and the params
1877
+ * @description Returns the formatted query with database driver placeholders and the params
1878
+ * @description Use this for debugging purposes to see the formatted SQL
1879
+ * @warning Does not apply any hook from the model
1880
+ */
1881
+ toSql(): ReturnType<typeof AstParser.prototype.parse>;
1882
+ /**
1883
+ * @description Returns the raw query with database driver placeholders and the params
1860
1884
  * @warning Does not apply any hook from the model
1861
1885
  */
1862
1886
  unWrap(): ReturnType<typeof AstParser.prototype.parse>;
@@ -2854,6 +2878,8 @@ type ColumnType = {
2854
2878
  precision?: number;
2855
2879
  scale?: number;
2856
2880
  withTimezone?: boolean;
2881
+ unsigned?: boolean;
2882
+ zerofill?: boolean;
2857
2883
  constraints?: {
2858
2884
  nullable?: boolean;
2859
2885
  default?: string | number | null | boolean;
@@ -4197,7 +4223,14 @@ declare class QueryBuilder<T extends Model = any, S extends Record<string, any>
4197
4223
  */
4198
4224
  toQuery(): string;
4199
4225
  /**
4200
- * @description Returns the query with database driver placeholders and the params
4226
+ * @description Returns the formatted query with database driver placeholders and the params
4227
+ * @description Use this for debugging purposes to see the formatted SQL
4228
+ * @warning Does not apply any hook from the model
4229
+ * @warning Does not show any `load` operations in the query, it only shows the operations that directly belong to the query builder instance
4230
+ */
4231
+ toSql(): ReturnType<typeof AstParser.prototype.parse>;
4232
+ /**
4233
+ * @description Returns the raw query with database driver placeholders and the params
4201
4234
  * @description To be used for executing the query with the database driver
4202
4235
  * @warning Does not apply any hook from the model
4203
4236
  * @warning Does not show any `load` operations in the query, it only shows the operations that directly belong to the query builder instance
@@ -4284,6 +4317,8 @@ type TableColumnInfo = {
4284
4317
  scale?: number | null;
4285
4318
  withTimezone?: boolean | null;
4286
4319
  enumValues?: string[] | null;
4320
+ unsigned?: boolean | null;
4321
+ zerofill?: boolean | null;
4287
4322
  };
4288
4323
  type TableIndexInfo = {
4289
4324
  name: string;
@@ -6307,12 +6342,23 @@ type ColStringOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "
6307
6342
  length?: number;
6308
6343
  };
6309
6344
  type ColTextOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "default">;
6310
- type ColIntegerOptions = Omit<ColumnOptions, "serialize" | "prepare" | "default">;
6311
- type ColBigIntegerOptions = Omit<ColumnOptions, "serialize" | "prepare" | "default">;
6312
- type ColFloatOptions = Omit<ColumnOptions, "serialize" | "prepare" | "default">;
6345
+ type ColIntegerOptions = Omit<ColumnOptions, "serialize" | "prepare" | "default"> & {
6346
+ unsigned?: boolean;
6347
+ zerofill?: boolean;
6348
+ };
6349
+ type ColBigIntegerOptions = Omit<ColumnOptions, "serialize" | "prepare" | "default"> & {
6350
+ unsigned?: boolean;
6351
+ zerofill?: boolean;
6352
+ };
6353
+ type ColFloatOptions = Omit<ColumnOptions, "serialize" | "prepare" | "default"> & {
6354
+ unsigned?: boolean;
6355
+ zerofill?: boolean;
6356
+ };
6313
6357
  type ColDecimalOptions = Omit<ColumnOptions, "serialize" | "prepare" | "default"> & {
6314
6358
  precision?: number;
6315
6359
  scale?: number;
6360
+ unsigned?: boolean;
6361
+ zerofill?: boolean;
6316
6362
  };
6317
6363
  type ColIncrementOptions = Omit<ColumnOptions, "serialize" | "prepare" | "primaryKey" | "nullable" | "default">;
6318
6364
  type ColBigIncrementOptions = Omit<ColumnOptions, "serialize" | "prepare" | "primaryKey" | "nullable" | "default">;
@@ -6335,9 +6381,18 @@ type ColCharOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "de
6335
6381
  type ColVarbinaryOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "default"> & {
6336
6382
  length?: number;
6337
6383
  };
6338
- type ColTinyIntOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "default">;
6339
- type ColSmallIntOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "default">;
6340
- type ColMediumIntOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "default">;
6384
+ type ColTinyIntOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "default"> & {
6385
+ unsigned?: boolean;
6386
+ zerofill?: boolean;
6387
+ };
6388
+ type ColSmallIntOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "default"> & {
6389
+ unsigned?: boolean;
6390
+ zerofill?: boolean;
6391
+ };
6392
+ type ColMediumIntOptions = Omit<ColumnOptions, "type" | "serialize" | "prepare" | "default"> & {
6393
+ unsigned?: boolean;
6394
+ zerofill?: boolean;
6395
+ };
6341
6396
  type RelationConstraintOptions = {
6342
6397
  /**
6343
6398
  * Useful for auto generated migrations to specify the on delete action, it does not affect the code wise implementation