hysteria-orm 10.5.5 → 10.5.6
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 +12 -12
- package/lib/cli.js.map +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +6 -28
- package/lib/index.d.ts +6 -28
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/lib/index.d.cts
CHANGED
|
@@ -2396,6 +2396,9 @@ declare class QueryBuilder<T extends Model = any, S extends Record<string, any>
|
|
|
2396
2396
|
* ```
|
|
2397
2397
|
*/
|
|
2398
2398
|
select<const Columns extends readonly Selectable[]>(...columns: Columns): QueryBuilder<T, ComposeBuildRawSelect<S, Columns>>;
|
|
2399
|
+
select<ValueType = any, Alias extends string = string>(cbOrQueryBuilder: ((subQuery: QueryBuilder<T>) => void) | QueryBuilder<any>, alias: Alias): QueryBuilder<T, ComposeRawSelect<S, {
|
|
2400
|
+
[K in Alias]: ValueType;
|
|
2401
|
+
}>>;
|
|
2399
2402
|
/**
|
|
2400
2403
|
* @description Adds a raw SELECT statement to the query with type safety.
|
|
2401
2404
|
* @description Use the generic parameter to specify the type of the selected columns.
|
|
@@ -2430,12 +2433,6 @@ declare class QueryBuilder<T extends Model = any, S extends Record<string, any>
|
|
|
2430
2433
|
selectFunc<F extends SqlFunction, Alias extends string>(sqlFunc: F, column: string, alias: Alias): QueryBuilder<T, ComposeRawSelect<S, {
|
|
2431
2434
|
[K in Alias]: SqlFunctionReturnType<F>;
|
|
2432
2435
|
}>>;
|
|
2433
|
-
/**
|
|
2434
|
-
* @description Selects a subquery, subquery must return a single column
|
|
2435
|
-
*/
|
|
2436
|
-
selectSubQuery<ValueType = any, Alias extends string = string>(cbOrQueryBuilder: ((subQuery: QueryBuilder<T>) => void) | QueryBuilder<any>, alias: Alias): QueryBuilder<T, ComposeRawSelect<S, {
|
|
2437
|
-
[K in Alias]: ValueType;
|
|
2438
|
-
}>>;
|
|
2439
2436
|
selectJson<ValueType = any, Alias extends string = string>(column: ModelKey<T> | string, path: JsonPathInput, alias: Alias): QueryBuilder<T, ComposeRawSelect<S, {
|
|
2440
2437
|
[K in Alias]: ValueType;
|
|
2441
2438
|
}>>;
|
|
@@ -4347,6 +4344,9 @@ declare class ModelQueryBuilder<T extends Model, S extends Record<string, any> =
|
|
|
4347
4344
|
* ```
|
|
4348
4345
|
*/
|
|
4349
4346
|
select<const Columns extends readonly ModelSelectableInput<T>[]>(...columns: Columns): ModelQueryBuilder<T, ComposeBuildSelect<S, T, Columns extends readonly (string | readonly [string, string])[] ? Columns : readonly (string | readonly [string, string])[]>, R>;
|
|
4347
|
+
select<ValueType = any, Alias extends string = string>(cbOrQueryBuilder: ((subQuery: QueryBuilder<T>) => void) | QueryBuilder<any>, alias: Alias): ModelQueryBuilder<T, ComposeSelect<S, {
|
|
4348
|
+
[K in Alias]: ValueType;
|
|
4349
|
+
}>, R>;
|
|
4350
4350
|
/**
|
|
4351
4351
|
* @description Adds a raw SELECT statement with type-safe return type.
|
|
4352
4352
|
* @description Use the generic parameter to specify the type of the selected columns.
|
|
@@ -4391,28 +4391,6 @@ declare class ModelQueryBuilder<T extends Model, S extends Record<string, any> =
|
|
|
4391
4391
|
selectFunc<F extends SqlFunction, Alias extends string>(sqlFunc: F, column: ModelKey<T> | "*" | (string & {}), alias: Alias): ModelQueryBuilder<T, ComposeSelect<S, {
|
|
4392
4392
|
[K in Alias]: SqlFunctionReturnType<F>;
|
|
4393
4393
|
}>, R>;
|
|
4394
|
-
/**
|
|
4395
|
-
* @description Selects a subquery with a typed alias
|
|
4396
|
-
* @param cbOrQueryBuilder A callback that receives a QueryBuilder or a QueryBuilder instance
|
|
4397
|
-
* @param alias The alias for the subquery result
|
|
4398
|
-
* @description Subquery must return a single column
|
|
4399
|
-
* @example
|
|
4400
|
-
* ```ts
|
|
4401
|
-
* const users = await User.query()
|
|
4402
|
-
* .select("id")
|
|
4403
|
-
* .selectSubQuery<number, "postCount">((subQuery) => {
|
|
4404
|
-
* subQuery
|
|
4405
|
-
* .select("COUNT(*)")
|
|
4406
|
-
* .from("posts")
|
|
4407
|
-
* .whereColumn("posts.user_id", "users.id");
|
|
4408
|
-
* }, "postCount")
|
|
4409
|
-
* .many();
|
|
4410
|
-
* // users[0].postCount is typed as number
|
|
4411
|
-
* ```
|
|
4412
|
-
*/
|
|
4413
|
-
selectSubQuery<ValueType = any, Alias extends string = string>(cbOrQueryBuilder: ((subQuery: QueryBuilder<T>) => void) | QueryBuilder<any>, alias: Alias): ModelQueryBuilder<T, ComposeSelect<S, {
|
|
4414
|
-
[K in Alias]: ValueType;
|
|
4415
|
-
}>, R>;
|
|
4416
4394
|
/**
|
|
4417
4395
|
* @description Clears the SELECT clause and resets to default model type
|
|
4418
4396
|
* @example
|
package/lib/index.d.ts
CHANGED
|
@@ -2396,6 +2396,9 @@ declare class QueryBuilder<T extends Model = any, S extends Record<string, any>
|
|
|
2396
2396
|
* ```
|
|
2397
2397
|
*/
|
|
2398
2398
|
select<const Columns extends readonly Selectable[]>(...columns: Columns): QueryBuilder<T, ComposeBuildRawSelect<S, Columns>>;
|
|
2399
|
+
select<ValueType = any, Alias extends string = string>(cbOrQueryBuilder: ((subQuery: QueryBuilder<T>) => void) | QueryBuilder<any>, alias: Alias): QueryBuilder<T, ComposeRawSelect<S, {
|
|
2400
|
+
[K in Alias]: ValueType;
|
|
2401
|
+
}>>;
|
|
2399
2402
|
/**
|
|
2400
2403
|
* @description Adds a raw SELECT statement to the query with type safety.
|
|
2401
2404
|
* @description Use the generic parameter to specify the type of the selected columns.
|
|
@@ -2430,12 +2433,6 @@ declare class QueryBuilder<T extends Model = any, S extends Record<string, any>
|
|
|
2430
2433
|
selectFunc<F extends SqlFunction, Alias extends string>(sqlFunc: F, column: string, alias: Alias): QueryBuilder<T, ComposeRawSelect<S, {
|
|
2431
2434
|
[K in Alias]: SqlFunctionReturnType<F>;
|
|
2432
2435
|
}>>;
|
|
2433
|
-
/**
|
|
2434
|
-
* @description Selects a subquery, subquery must return a single column
|
|
2435
|
-
*/
|
|
2436
|
-
selectSubQuery<ValueType = any, Alias extends string = string>(cbOrQueryBuilder: ((subQuery: QueryBuilder<T>) => void) | QueryBuilder<any>, alias: Alias): QueryBuilder<T, ComposeRawSelect<S, {
|
|
2437
|
-
[K in Alias]: ValueType;
|
|
2438
|
-
}>>;
|
|
2439
2436
|
selectJson<ValueType = any, Alias extends string = string>(column: ModelKey<T> | string, path: JsonPathInput, alias: Alias): QueryBuilder<T, ComposeRawSelect<S, {
|
|
2440
2437
|
[K in Alias]: ValueType;
|
|
2441
2438
|
}>>;
|
|
@@ -4347,6 +4344,9 @@ declare class ModelQueryBuilder<T extends Model, S extends Record<string, any> =
|
|
|
4347
4344
|
* ```
|
|
4348
4345
|
*/
|
|
4349
4346
|
select<const Columns extends readonly ModelSelectableInput<T>[]>(...columns: Columns): ModelQueryBuilder<T, ComposeBuildSelect<S, T, Columns extends readonly (string | readonly [string, string])[] ? Columns : readonly (string | readonly [string, string])[]>, R>;
|
|
4347
|
+
select<ValueType = any, Alias extends string = string>(cbOrQueryBuilder: ((subQuery: QueryBuilder<T>) => void) | QueryBuilder<any>, alias: Alias): ModelQueryBuilder<T, ComposeSelect<S, {
|
|
4348
|
+
[K in Alias]: ValueType;
|
|
4349
|
+
}>, R>;
|
|
4350
4350
|
/**
|
|
4351
4351
|
* @description Adds a raw SELECT statement with type-safe return type.
|
|
4352
4352
|
* @description Use the generic parameter to specify the type of the selected columns.
|
|
@@ -4391,28 +4391,6 @@ declare class ModelQueryBuilder<T extends Model, S extends Record<string, any> =
|
|
|
4391
4391
|
selectFunc<F extends SqlFunction, Alias extends string>(sqlFunc: F, column: ModelKey<T> | "*" | (string & {}), alias: Alias): ModelQueryBuilder<T, ComposeSelect<S, {
|
|
4392
4392
|
[K in Alias]: SqlFunctionReturnType<F>;
|
|
4393
4393
|
}>, R>;
|
|
4394
|
-
/**
|
|
4395
|
-
* @description Selects a subquery with a typed alias
|
|
4396
|
-
* @param cbOrQueryBuilder A callback that receives a QueryBuilder or a QueryBuilder instance
|
|
4397
|
-
* @param alias The alias for the subquery result
|
|
4398
|
-
* @description Subquery must return a single column
|
|
4399
|
-
* @example
|
|
4400
|
-
* ```ts
|
|
4401
|
-
* const users = await User.query()
|
|
4402
|
-
* .select("id")
|
|
4403
|
-
* .selectSubQuery<number, "postCount">((subQuery) => {
|
|
4404
|
-
* subQuery
|
|
4405
|
-
* .select("COUNT(*)")
|
|
4406
|
-
* .from("posts")
|
|
4407
|
-
* .whereColumn("posts.user_id", "users.id");
|
|
4408
|
-
* }, "postCount")
|
|
4409
|
-
* .many();
|
|
4410
|
-
* // users[0].postCount is typed as number
|
|
4411
|
-
* ```
|
|
4412
|
-
*/
|
|
4413
|
-
selectSubQuery<ValueType = any, Alias extends string = string>(cbOrQueryBuilder: ((subQuery: QueryBuilder<T>) => void) | QueryBuilder<any>, alias: Alias): ModelQueryBuilder<T, ComposeSelect<S, {
|
|
4414
|
-
[K in Alias]: ValueType;
|
|
4415
|
-
}>, R>;
|
|
4416
4394
|
/**
|
|
4417
4395
|
* @description Clears the SELECT clause and resets to default model type
|
|
4418
4396
|
* @example
|