hysteria-orm 11.0.6 → 11.0.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/lib/index.d.cts CHANGED
@@ -3287,6 +3287,16 @@ type ColumnOptions = {
3287
3287
  * @description Per-column validators applied on insert/update
3288
3288
  */
3289
3289
  validate?: Validator | Validator[];
3290
+ /**
3291
+ * @description MySQL/MariaDB only: declare the numeric column as UNSIGNED
3292
+ * @migration Only affects auto-generated migrations
3293
+ */
3294
+ unsigned?: boolean;
3295
+ /**
3296
+ * @description MySQL/MariaDB only: declare the numeric column with ZEROFILL display attribute
3297
+ * @migration Only affects auto-generated migrations
3298
+ */
3299
+ zerofill?: boolean;
3290
3300
  } &
3291
3301
  /**
3292
3302
  * @description The data type of the column
@@ -3312,6 +3322,7 @@ type ColumnType = {
3312
3322
  withTimezone?: boolean;
3313
3323
  unsigned?: boolean;
3314
3324
  zerofill?: boolean;
3325
+ stringMode?: boolean;
3315
3326
  constraints?: {
3316
3327
  nullable?: boolean;
3317
3328
  default?: string | number | null | boolean;
@@ -4680,6 +4691,7 @@ type TableColumnInfo = {
4680
4691
  enumValues?: string[] | null;
4681
4692
  unsigned?: boolean | null;
4682
4693
  zerofill?: boolean | null;
4694
+ stringMode?: boolean | null;
4683
4695
  };
4684
4696
  type TableIndexInfo = {
4685
4697
  name: string;
@@ -4870,6 +4882,7 @@ declare const SQL_DATA_SOURCE_SYMBOL: unique symbol;
4870
4882
  declare class SqlDataSource<D extends SqlDataSourceType = SqlDataSourceType, T extends Record<string, SqlDataSourceModel> = {}, C extends CacheKeys = {}> extends DataSource {
4871
4883
  private readonly [SQL_DATA_SOURCE_SYMBOL];
4872
4884
  private globalTransaction;
4885
+ private globalTransactionLock;
4873
4886
  private sqlType;
4874
4887
  private ownsPool;
4875
4888
  static isSqlDataSource(value: unknown): value is SqlDataSource;
@@ -4907,10 +4920,18 @@ declare class SqlDataSource<D extends SqlDataSourceType = SqlDataSourceType, T e
4907
4920
  */
4908
4921
  inputDetails: SqlDataSourceInput<D, T, C>;
4909
4922
  /**
4910
- * @description Unique identifier shared across all clones of the same logical data source.
4911
- * Used to verify ALS transactions belong to this instance.
4923
+ * @description Per-construction UUID. May be shared with clones produced by
4924
+ * clone() (legacy behavior, preserved for backward compatibility).
4925
+ * For ALS scope checks, use logicalSourceId.
4912
4926
  */
4913
4927
  id: string;
4928
+ /**
4929
+ * Shared across all clones of the same logical data source.
4930
+ * Used by the ALS transaction guard to verify that a propagated
4931
+ * transaction belongs to the same logical source as the calling
4932
+ * instance (not necessarily the same instance).
4933
+ */
4934
+ logicalSourceId: string;
4914
4935
  /**
4915
4936
  * @description Whether AsyncLocalStorage (CLS) transaction auto-propagation is enabled.
4916
4937
  */
@@ -5144,6 +5165,9 @@ declare class SqlDataSource<D extends SqlDataSourceType = SqlDataSourceType, T e
5144
5165
  /**
5145
5166
  * @description Starts a global transaction on the database
5146
5167
  * @description Intended for testing purposes - wraps all operations in a transaction that can be rolled back
5168
+ * @description Concurrent calls serialize: the second caller waits for the
5169
+ * @description first to settle, then rejects with GLOBAL_TRANSACTION_ALREADY_STARTED
5170
+ * @description if a global transaction is still active.
5147
5171
  */
5148
5172
  startGlobalTransaction(options?: StartTransactionOptions): Promise<Transaction>;
5149
5173
  /**
package/lib/index.d.ts CHANGED
@@ -3287,6 +3287,16 @@ type ColumnOptions = {
3287
3287
  * @description Per-column validators applied on insert/update
3288
3288
  */
3289
3289
  validate?: Validator | Validator[];
3290
+ /**
3291
+ * @description MySQL/MariaDB only: declare the numeric column as UNSIGNED
3292
+ * @migration Only affects auto-generated migrations
3293
+ */
3294
+ unsigned?: boolean;
3295
+ /**
3296
+ * @description MySQL/MariaDB only: declare the numeric column with ZEROFILL display attribute
3297
+ * @migration Only affects auto-generated migrations
3298
+ */
3299
+ zerofill?: boolean;
3290
3300
  } &
3291
3301
  /**
3292
3302
  * @description The data type of the column
@@ -3312,6 +3322,7 @@ type ColumnType = {
3312
3322
  withTimezone?: boolean;
3313
3323
  unsigned?: boolean;
3314
3324
  zerofill?: boolean;
3325
+ stringMode?: boolean;
3315
3326
  constraints?: {
3316
3327
  nullable?: boolean;
3317
3328
  default?: string | number | null | boolean;
@@ -4680,6 +4691,7 @@ type TableColumnInfo = {
4680
4691
  enumValues?: string[] | null;
4681
4692
  unsigned?: boolean | null;
4682
4693
  zerofill?: boolean | null;
4694
+ stringMode?: boolean | null;
4683
4695
  };
4684
4696
  type TableIndexInfo = {
4685
4697
  name: string;
@@ -4870,6 +4882,7 @@ declare const SQL_DATA_SOURCE_SYMBOL: unique symbol;
4870
4882
  declare class SqlDataSource<D extends SqlDataSourceType = SqlDataSourceType, T extends Record<string, SqlDataSourceModel> = {}, C extends CacheKeys = {}> extends DataSource {
4871
4883
  private readonly [SQL_DATA_SOURCE_SYMBOL];
4872
4884
  private globalTransaction;
4885
+ private globalTransactionLock;
4873
4886
  private sqlType;
4874
4887
  private ownsPool;
4875
4888
  static isSqlDataSource(value: unknown): value is SqlDataSource;
@@ -4907,10 +4920,18 @@ declare class SqlDataSource<D extends SqlDataSourceType = SqlDataSourceType, T e
4907
4920
  */
4908
4921
  inputDetails: SqlDataSourceInput<D, T, C>;
4909
4922
  /**
4910
- * @description Unique identifier shared across all clones of the same logical data source.
4911
- * Used to verify ALS transactions belong to this instance.
4923
+ * @description Per-construction UUID. May be shared with clones produced by
4924
+ * clone() (legacy behavior, preserved for backward compatibility).
4925
+ * For ALS scope checks, use logicalSourceId.
4912
4926
  */
4913
4927
  id: string;
4928
+ /**
4929
+ * Shared across all clones of the same logical data source.
4930
+ * Used by the ALS transaction guard to verify that a propagated
4931
+ * transaction belongs to the same logical source as the calling
4932
+ * instance (not necessarily the same instance).
4933
+ */
4934
+ logicalSourceId: string;
4914
4935
  /**
4915
4936
  * @description Whether AsyncLocalStorage (CLS) transaction auto-propagation is enabled.
4916
4937
  */
@@ -5144,6 +5165,9 @@ declare class SqlDataSource<D extends SqlDataSourceType = SqlDataSourceType, T e
5144
5165
  /**
5145
5166
  * @description Starts a global transaction on the database
5146
5167
  * @description Intended for testing purposes - wraps all operations in a transaction that can be rolled back
5168
+ * @description Concurrent calls serialize: the second caller waits for the
5169
+ * @description first to settle, then rejects with GLOBAL_TRANSACTION_ALREADY_STARTED
5170
+ * @description if a global transaction is still active.
5147
5171
  */
5148
5172
  startGlobalTransaction(options?: StartTransactionOptions): Promise<Transaction>;
5149
5173
  /**