hysteria-orm 10.0.5 → 10.0.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/index.d.cts CHANGED
@@ -2401,6 +2401,10 @@ type PaginateWithCursorOptions<T extends Model, K extends ModelKey<T>> = {
2401
2401
  operator?: "<" | ">";
2402
2402
  orderBy?: "asc" | "desc";
2403
2403
  };
2404
+ type UpsertOptionsRawBuilder = {
2405
+ updateOnConflict?: boolean;
2406
+ returning?: string[];
2407
+ };
2404
2408
 
2405
2409
  declare class SqlModelManagerUtils<T extends Model> {
2406
2410
  protected dbType: SqlDataSourceType;
@@ -3324,6 +3328,47 @@ declare class AstParser {
3324
3328
  private mapCommonDbType;
3325
3329
  }
3326
3330
 
3331
+ declare class DeleteNode extends QueryNode {
3332
+ fromNode: FromNode;
3333
+ chainsWith: string;
3334
+ canKeywordBeSeenMultipleTimes: boolean;
3335
+ folder: string;
3336
+ file: string;
3337
+ constructor(fromNode: FromNode, isRawValue?: boolean);
3338
+ }
3339
+
3340
+ declare class InsertNode extends QueryNode {
3341
+ fromNode: FromNode;
3342
+ records: Record<string, any>[];
3343
+ returning?: string[];
3344
+ disableReturning: boolean;
3345
+ chainsWith: string;
3346
+ canKeywordBeSeenMultipleTimes: boolean;
3347
+ folder: string;
3348
+ file: string;
3349
+ constructor(fromNode: FromNode, records?: Record<string, any>[], returning?: string[], disableReturning?: boolean, isRawValue?: boolean);
3350
+ }
3351
+
3352
+ declare class TruncateNode extends QueryNode {
3353
+ fromNode: FromNode | string;
3354
+ chainsWith: string;
3355
+ canKeywordBeSeenMultipleTimes: boolean;
3356
+ folder: string;
3357
+ file: string;
3358
+ constructor(fromNode: FromNode | string, isRawValue?: boolean);
3359
+ }
3360
+
3361
+ declare class UpdateNode extends QueryNode {
3362
+ fromNode: FromNode;
3363
+ columns: string[];
3364
+ values: (any | RawNode)[];
3365
+ chainsWith: string;
3366
+ canKeywordBeSeenMultipleTimes: boolean;
3367
+ folder: string;
3368
+ file: string;
3369
+ constructor(fromNode: FromNode, columns?: string[], values?: (any | RawNode)[], isRawValue?: boolean);
3370
+ }
3371
+
3327
3372
  declare class QueryBuilder<T extends Model = any> extends JsonQueryBuilder<T> {
3328
3373
  model: typeof Model;
3329
3374
  protected astParser: AstParser;
@@ -3333,6 +3378,10 @@ declare class QueryBuilder<T extends Model = any> extends JsonQueryBuilder<T> {
3333
3378
  protected isNestedCondition: boolean;
3334
3379
  protected mustRemoveAnnotations: boolean;
3335
3380
  protected interpreterUtils: InterpreterUtils;
3381
+ protected insertNode: InsertNode | null;
3382
+ protected updateNode: UpdateNode | null;
3383
+ protected deleteNode: DeleteNode | null;
3384
+ protected truncateNode: TruncateNode | null;
3336
3385
  /**
3337
3386
  * @description Performance methods that return the time that took to execute the query with the result
3338
3387
  */
@@ -3584,6 +3633,22 @@ declare class QueryBuilder<T extends Model = any> extends JsonQueryBuilder<T> {
3584
3633
  * @returns raw driver response
3585
3634
  */
3586
3635
  insertMany(data: Record<string, any>[], returning?: string[]): Promise<T[]>;
3636
+ /**
3637
+ * @description Updates or creates a new record using upsert functionality
3638
+ * @param data The data to insert or update
3639
+ * @param searchCriteria The criteria to search for existing records
3640
+ * @param options Upsert options including updateOnConflict and returning columns
3641
+ * @returns The upserted record
3642
+ */
3643
+ upsert<O extends Record<string, any>>(data: O, searchCriteria: Partial<O>, options?: UpsertOptionsRawBuilder): Promise<T[]>;
3644
+ /**
3645
+ * @description Updates or creates multiple records using upsert functionality
3646
+ * @param conflictColumns The columns to check for conflicts
3647
+ * @param columnsToUpdate The columns to update on conflict
3648
+ * @param data Array of data objects to insert or update
3649
+ * @param options Upsert options including updateOnConflict and returning columns
3650
+ */
3651
+ upsertMany<O extends Record<string, any>>(conflictColumns: string[], columnsToUpdate: string[], data: O[], options?: UpsertOptionsRawBuilder): Promise<T[]>;
3587
3652
  /**
3588
3653
  * @description Updates records from a table
3589
3654
  * @returns the number of affected rows
package/lib/index.d.ts CHANGED
@@ -2401,6 +2401,10 @@ type PaginateWithCursorOptions<T extends Model, K extends ModelKey<T>> = {
2401
2401
  operator?: "<" | ">";
2402
2402
  orderBy?: "asc" | "desc";
2403
2403
  };
2404
+ type UpsertOptionsRawBuilder = {
2405
+ updateOnConflict?: boolean;
2406
+ returning?: string[];
2407
+ };
2404
2408
 
2405
2409
  declare class SqlModelManagerUtils<T extends Model> {
2406
2410
  protected dbType: SqlDataSourceType;
@@ -3324,6 +3328,47 @@ declare class AstParser {
3324
3328
  private mapCommonDbType;
3325
3329
  }
3326
3330
 
3331
+ declare class DeleteNode extends QueryNode {
3332
+ fromNode: FromNode;
3333
+ chainsWith: string;
3334
+ canKeywordBeSeenMultipleTimes: boolean;
3335
+ folder: string;
3336
+ file: string;
3337
+ constructor(fromNode: FromNode, isRawValue?: boolean);
3338
+ }
3339
+
3340
+ declare class InsertNode extends QueryNode {
3341
+ fromNode: FromNode;
3342
+ records: Record<string, any>[];
3343
+ returning?: string[];
3344
+ disableReturning: boolean;
3345
+ chainsWith: string;
3346
+ canKeywordBeSeenMultipleTimes: boolean;
3347
+ folder: string;
3348
+ file: string;
3349
+ constructor(fromNode: FromNode, records?: Record<string, any>[], returning?: string[], disableReturning?: boolean, isRawValue?: boolean);
3350
+ }
3351
+
3352
+ declare class TruncateNode extends QueryNode {
3353
+ fromNode: FromNode | string;
3354
+ chainsWith: string;
3355
+ canKeywordBeSeenMultipleTimes: boolean;
3356
+ folder: string;
3357
+ file: string;
3358
+ constructor(fromNode: FromNode | string, isRawValue?: boolean);
3359
+ }
3360
+
3361
+ declare class UpdateNode extends QueryNode {
3362
+ fromNode: FromNode;
3363
+ columns: string[];
3364
+ values: (any | RawNode)[];
3365
+ chainsWith: string;
3366
+ canKeywordBeSeenMultipleTimes: boolean;
3367
+ folder: string;
3368
+ file: string;
3369
+ constructor(fromNode: FromNode, columns?: string[], values?: (any | RawNode)[], isRawValue?: boolean);
3370
+ }
3371
+
3327
3372
  declare class QueryBuilder<T extends Model = any> extends JsonQueryBuilder<T> {
3328
3373
  model: typeof Model;
3329
3374
  protected astParser: AstParser;
@@ -3333,6 +3378,10 @@ declare class QueryBuilder<T extends Model = any> extends JsonQueryBuilder<T> {
3333
3378
  protected isNestedCondition: boolean;
3334
3379
  protected mustRemoveAnnotations: boolean;
3335
3380
  protected interpreterUtils: InterpreterUtils;
3381
+ protected insertNode: InsertNode | null;
3382
+ protected updateNode: UpdateNode | null;
3383
+ protected deleteNode: DeleteNode | null;
3384
+ protected truncateNode: TruncateNode | null;
3336
3385
  /**
3337
3386
  * @description Performance methods that return the time that took to execute the query with the result
3338
3387
  */
@@ -3584,6 +3633,22 @@ declare class QueryBuilder<T extends Model = any> extends JsonQueryBuilder<T> {
3584
3633
  * @returns raw driver response
3585
3634
  */
3586
3635
  insertMany(data: Record<string, any>[], returning?: string[]): Promise<T[]>;
3636
+ /**
3637
+ * @description Updates or creates a new record using upsert functionality
3638
+ * @param data The data to insert or update
3639
+ * @param searchCriteria The criteria to search for existing records
3640
+ * @param options Upsert options including updateOnConflict and returning columns
3641
+ * @returns The upserted record
3642
+ */
3643
+ upsert<O extends Record<string, any>>(data: O, searchCriteria: Partial<O>, options?: UpsertOptionsRawBuilder): Promise<T[]>;
3644
+ /**
3645
+ * @description Updates or creates multiple records using upsert functionality
3646
+ * @param conflictColumns The columns to check for conflicts
3647
+ * @param columnsToUpdate The columns to update on conflict
3648
+ * @param data Array of data objects to insert or update
3649
+ * @param options Upsert options including updateOnConflict and returning columns
3650
+ */
3651
+ upsertMany<O extends Record<string, any>>(conflictColumns: string[], columnsToUpdate: string[], data: O[], options?: UpsertOptionsRawBuilder): Promise<T[]>;
3587
3652
  /**
3588
3653
  * @description Updates records from a table
3589
3654
  * @returns the number of affected rows