hysteria-orm 11.0.6 → 11.0.8
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/cli.js +23 -23
- package/lib/cli.js.map +1 -1
- package/lib/index.cjs +15 -15
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +32 -8
- package/lib/index.d.ts +32 -8
- package/lib/index.js +15 -15
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/lib/index.d.cts
CHANGED
|
@@ -2072,15 +2072,15 @@ declare class ModelManager<T extends Model> {
|
|
|
2072
2072
|
/**
|
|
2073
2073
|
* @description Finds all records that match the input
|
|
2074
2074
|
*/
|
|
2075
|
-
find<S extends ModelKey<T>[] = never[], R extends ModelRelation<T>[] = never[]>(input?: FindType<T, S, R>): Promise<
|
|
2075
|
+
find<S extends ModelKey<T>[] = never[], R extends ModelRelation<T>[] = never[]>(input?: FindType<T, S, R>): Promise<FindReturnType<T, S, R>[]>;
|
|
2076
2076
|
/**
|
|
2077
2077
|
* @description Finds the first record that matches the input
|
|
2078
2078
|
*/
|
|
2079
|
-
findOne<S extends ModelKey<T>[] = never[], R extends ModelRelation<T>[] = never[]>(input: FindOneType<T, S, R>): Promise<
|
|
2079
|
+
findOne<S extends ModelKey<T>[] = never[], R extends ModelRelation<T>[] = never[]>(input: FindOneType<T, S, R>): Promise<FindReturnType<T, S, R> | null>;
|
|
2080
2080
|
/**
|
|
2081
2081
|
* @description Finds the first record that matches the input or throws an error
|
|
2082
2082
|
*/
|
|
2083
|
-
findOneOrFail<S extends ModelKey<T>[] = never[], R extends ModelRelation<T>[] = never[]>(input: FindOneType<T, S, R>): Promise<
|
|
2083
|
+
findOneOrFail<S extends ModelKey<T>[] = never[], R extends ModelRelation<T>[] = never[]>(input: FindOneType<T, S, R>): Promise<FindReturnType<T, S, R>>;
|
|
2084
2084
|
/**
|
|
2085
2085
|
* @description Finds a record by its primary key
|
|
2086
2086
|
* @description Ignores all model hooks
|
|
@@ -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
|
|
4911
|
-
*
|
|
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
|
/**
|
|
@@ -6169,15 +6193,15 @@ declare class ModelQueryBuilder<T extends Model, S extends Record<string, any> =
|
|
|
6169
6193
|
/**
|
|
6170
6194
|
* @description Finds multiple records.
|
|
6171
6195
|
*/
|
|
6172
|
-
find<MK extends ModelKey<T>[] = never[], MR extends ModelRelation<T>[] = never[]>(input?: FindType<T, MK, MR>): Promise<
|
|
6196
|
+
find<MK extends ModelKey<T>[] = never[], MR extends ModelRelation<T>[] = never[]>(input?: FindType<T, MK, MR>): Promise<FindReturnType<T, MK, MR>[]>;
|
|
6173
6197
|
/**
|
|
6174
6198
|
* @description Finds a single record.
|
|
6175
6199
|
*/
|
|
6176
|
-
findOne<MK extends ModelKey<T>[] = never[], MR extends ModelRelation<T>[] = never[]>(input: FindOneType<T, MK, MR>): Promise<
|
|
6200
|
+
findOne<MK extends ModelKey<T>[] = never[], MR extends ModelRelation<T>[] = never[]>(input: FindOneType<T, MK, MR>): Promise<FindReturnType<T, MK, MR> | null>;
|
|
6177
6201
|
/**
|
|
6178
6202
|
* @description Finds a single record or throws.
|
|
6179
6203
|
*/
|
|
6180
|
-
findOneOrFail<MK extends ModelKey<T>[] = never[], MR extends ModelRelation<T>[] = never[]>(input: FindOneType<T, MK, MR>): Promise<
|
|
6204
|
+
findOneOrFail<MK extends ModelKey<T>[] = never[], MR extends ModelRelation<T>[] = never[]>(input: FindOneType<T, MK, MR>): Promise<FindReturnType<T, MK, MR>>;
|
|
6181
6205
|
/**
|
|
6182
6206
|
* @description Finds a single record by primary key.
|
|
6183
6207
|
*/
|
package/lib/index.d.ts
CHANGED
|
@@ -2072,15 +2072,15 @@ declare class ModelManager<T extends Model> {
|
|
|
2072
2072
|
/**
|
|
2073
2073
|
* @description Finds all records that match the input
|
|
2074
2074
|
*/
|
|
2075
|
-
find<S extends ModelKey<T>[] = never[], R extends ModelRelation<T>[] = never[]>(input?: FindType<T, S, R>): Promise<
|
|
2075
|
+
find<S extends ModelKey<T>[] = never[], R extends ModelRelation<T>[] = never[]>(input?: FindType<T, S, R>): Promise<FindReturnType<T, S, R>[]>;
|
|
2076
2076
|
/**
|
|
2077
2077
|
* @description Finds the first record that matches the input
|
|
2078
2078
|
*/
|
|
2079
|
-
findOne<S extends ModelKey<T>[] = never[], R extends ModelRelation<T>[] = never[]>(input: FindOneType<T, S, R>): Promise<
|
|
2079
|
+
findOne<S extends ModelKey<T>[] = never[], R extends ModelRelation<T>[] = never[]>(input: FindOneType<T, S, R>): Promise<FindReturnType<T, S, R> | null>;
|
|
2080
2080
|
/**
|
|
2081
2081
|
* @description Finds the first record that matches the input or throws an error
|
|
2082
2082
|
*/
|
|
2083
|
-
findOneOrFail<S extends ModelKey<T>[] = never[], R extends ModelRelation<T>[] = never[]>(input: FindOneType<T, S, R>): Promise<
|
|
2083
|
+
findOneOrFail<S extends ModelKey<T>[] = never[], R extends ModelRelation<T>[] = never[]>(input: FindOneType<T, S, R>): Promise<FindReturnType<T, S, R>>;
|
|
2084
2084
|
/**
|
|
2085
2085
|
* @description Finds a record by its primary key
|
|
2086
2086
|
* @description Ignores all model hooks
|
|
@@ -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
|
|
4911
|
-
*
|
|
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
|
/**
|
|
@@ -6169,15 +6193,15 @@ declare class ModelQueryBuilder<T extends Model, S extends Record<string, any> =
|
|
|
6169
6193
|
/**
|
|
6170
6194
|
* @description Finds multiple records.
|
|
6171
6195
|
*/
|
|
6172
|
-
find<MK extends ModelKey<T>[] = never[], MR extends ModelRelation<T>[] = never[]>(input?: FindType<T, MK, MR>): Promise<
|
|
6196
|
+
find<MK extends ModelKey<T>[] = never[], MR extends ModelRelation<T>[] = never[]>(input?: FindType<T, MK, MR>): Promise<FindReturnType<T, MK, MR>[]>;
|
|
6173
6197
|
/**
|
|
6174
6198
|
* @description Finds a single record.
|
|
6175
6199
|
*/
|
|
6176
|
-
findOne<MK extends ModelKey<T>[] = never[], MR extends ModelRelation<T>[] = never[]>(input: FindOneType<T, MK, MR>): Promise<
|
|
6200
|
+
findOne<MK extends ModelKey<T>[] = never[], MR extends ModelRelation<T>[] = never[]>(input: FindOneType<T, MK, MR>): Promise<FindReturnType<T, MK, MR> | null>;
|
|
6177
6201
|
/**
|
|
6178
6202
|
* @description Finds a single record or throws.
|
|
6179
6203
|
*/
|
|
6180
|
-
findOneOrFail<MK extends ModelKey<T>[] = never[], MR extends ModelRelation<T>[] = never[]>(input: FindOneType<T, MK, MR>): Promise<
|
|
6204
|
+
findOneOrFail<MK extends ModelKey<T>[] = never[], MR extends ModelRelation<T>[] = never[]>(input: FindOneType<T, MK, MR>): Promise<FindReturnType<T, MK, MR>>;
|
|
6181
6205
|
/**
|
|
6182
6206
|
* @description Finds a single record by primary key.
|
|
6183
6207
|
*/
|