relq 1.0.39 → 1.0.40
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/dist/cjs/core/helpers/ConnectedDeleteBuilder.cjs +3 -0
- package/dist/cjs/core/helpers/ConnectedInsertBuilder.cjs +3 -0
- package/dist/cjs/core/helpers/ConnectedUpdateBuilder.cjs +3 -0
- package/dist/config.d.ts +3 -2
- package/dist/esm/core/helpers/ConnectedDeleteBuilder.js +3 -0
- package/dist/esm/core/helpers/ConnectedInsertBuilder.js +3 -0
- package/dist/esm/core/helpers/ConnectedUpdateBuilder.js +3 -0
- package/dist/index.d.ts +39 -8
- package/dist/schema-builder.d.ts +3 -2
- package/package.json +1 -1
|
@@ -26,6 +26,9 @@ class ConnectedDeleteBuilder {
|
|
|
26
26
|
return result.metadata.rowCount ?? 0;
|
|
27
27
|
}
|
|
28
28
|
returning(columns) {
|
|
29
|
+
if (columns === null) {
|
|
30
|
+
return this;
|
|
31
|
+
}
|
|
29
32
|
this.builder.returning(columns);
|
|
30
33
|
return new ReturningExecutor_1.ReturningExecutor(this.builder, this.relq);
|
|
31
34
|
}
|
|
@@ -49,6 +49,9 @@ class ConnectedInsertBuilder {
|
|
|
49
49
|
return result.metadata.rowCount ?? 0;
|
|
50
50
|
}
|
|
51
51
|
returning(columns) {
|
|
52
|
+
if (columns === null) {
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
52
55
|
this.builder.returning(columns);
|
|
53
56
|
return new ReturningExecutor_1.ReturningExecutor(this.builder, this.relq);
|
|
54
57
|
}
|
|
@@ -27,6 +27,9 @@ class ConnectedUpdateBuilder {
|
|
|
27
27
|
return result.metadata.rowCount ?? 0;
|
|
28
28
|
}
|
|
29
29
|
returning(columns) {
|
|
30
|
+
if (columns === null) {
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
30
33
|
this.builder.returning(columns);
|
|
31
34
|
return new ReturningExecutor_1.ReturningExecutor(this.builder, this.relq);
|
|
32
35
|
}
|
package/dist/config.d.ts
CHANGED
|
@@ -536,9 +536,10 @@ export type Simplify<T> = {
|
|
|
536
536
|
[K in keyof T]: T[K];
|
|
537
537
|
} & {};
|
|
538
538
|
/**
|
|
539
|
-
* Clean a column type by removing DefaultValue union members
|
|
539
|
+
* Clean a column type by removing DefaultValue union members and symbols
|
|
540
|
+
* (symbols like EMPTY_OBJECT/EMPTY_ARRAY can leak into type inference from $default)
|
|
540
541
|
*/
|
|
541
|
-
export type CleanType<T> = Exclude<T, DefaultValue | (object & DefaultValue)>;
|
|
542
|
+
export type CleanType<T> = Exclude<T, DefaultValue | (object & DefaultValue) | symbol>;
|
|
542
543
|
/**
|
|
543
544
|
* Build SELECT type with smart required/optional:
|
|
544
545
|
* - Required: NOT NULL, PRIMARY KEY, has DEFAULT/GENERATED columns
|
package/dist/index.d.ts
CHANGED
|
@@ -474,9 +474,10 @@ export type Simplify<T> = {
|
|
|
474
474
|
[K in keyof T]: T[K];
|
|
475
475
|
} & {};
|
|
476
476
|
/**
|
|
477
|
-
* Clean a column type by removing DefaultValue union members
|
|
477
|
+
* Clean a column type by removing DefaultValue union members and symbols
|
|
478
|
+
* (symbols like EMPTY_OBJECT/EMPTY_ARRAY can leak into type inference from $default)
|
|
478
479
|
*/
|
|
479
|
-
export type CleanType<T> = Exclude<T, DefaultValue | (object & DefaultValue)>;
|
|
480
|
+
export type CleanType<T> = Exclude<T, DefaultValue | (object & DefaultValue) | symbol>;
|
|
480
481
|
/**
|
|
481
482
|
* Build SELECT type with smart required/optional:
|
|
482
483
|
* - Required: NOT NULL, PRIMARY KEY, has DEFAULT/GENERATED columns
|
|
@@ -6579,12 +6580,22 @@ declare class ConnectedDeleteBuilder<TTable = any> {
|
|
|
6579
6580
|
/**
|
|
6580
6581
|
* Set RETURNING clause - returns executor with typed run()
|
|
6581
6582
|
* Use '*' to return all columns, or specify column names
|
|
6583
|
+
* Pass null to skip RETURNING clause (useful for conditional returning)
|
|
6582
6584
|
*/
|
|
6583
|
-
returning
|
|
6585
|
+
returning(columns: null): this;
|
|
6586
|
+
returning(columns: "*"): ReturningExecutor<TTable extends {
|
|
6587
|
+
$inferSelect: infer S;
|
|
6588
|
+
} ? S : TTable>;
|
|
6589
|
+
returning<K extends string & ColumnName<TTable>>(columns: K | K[]): ReturningExecutor<Prettify<Pick<TTable extends {
|
|
6590
|
+
$inferSelect: infer S;
|
|
6591
|
+
} ? S : TTable, K & keyof (TTable extends {
|
|
6592
|
+
$inferSelect: infer S;
|
|
6593
|
+
} ? S : TTable)>>>;
|
|
6594
|
+
returning<K extends string & ColumnName<TTable>>(columns: K[] | null): this | ReturningExecutor<Prettify<Pick<TTable extends {
|
|
6584
6595
|
$inferSelect: infer S;
|
|
6585
6596
|
} ? S : TTable, K & keyof (TTable extends {
|
|
6586
6597
|
$inferSelect: infer S;
|
|
6587
|
-
} ? S : TTable)
|
|
6598
|
+
} ? S : TTable)>>>;
|
|
6588
6599
|
}
|
|
6589
6600
|
declare class ConnectedInsertBuilder<TTable = any> {
|
|
6590
6601
|
private builder;
|
|
@@ -6623,12 +6634,22 @@ declare class ConnectedInsertBuilder<TTable = any> {
|
|
|
6623
6634
|
/**
|
|
6624
6635
|
* Set RETURNING clause - returns executor with typed run()
|
|
6625
6636
|
* Use '*' to return all columns, or specify column names
|
|
6637
|
+
* Pass null to skip RETURNING clause (useful for conditional returning)
|
|
6626
6638
|
*/
|
|
6627
|
-
returning
|
|
6639
|
+
returning(columns: null): this;
|
|
6640
|
+
returning(columns: "*"): ReturningExecutor<TTable extends {
|
|
6641
|
+
$inferSelect: infer S;
|
|
6642
|
+
} ? S : TTable>;
|
|
6643
|
+
returning<K extends string & ColumnName<TTable>>(columns: K | K[]): ReturningExecutor<Prettify<Pick<TTable extends {
|
|
6644
|
+
$inferSelect: infer S;
|
|
6645
|
+
} ? S : TTable, K & keyof (TTable extends {
|
|
6646
|
+
$inferSelect: infer S;
|
|
6647
|
+
} ? S : TTable)>>>;
|
|
6648
|
+
returning<K extends string & ColumnName<TTable>>(columns: K[] | null): this | ReturningExecutor<Prettify<Pick<TTable extends {
|
|
6628
6649
|
$inferSelect: infer S;
|
|
6629
6650
|
} ? S : TTable, K & keyof (TTable extends {
|
|
6630
6651
|
$inferSelect: infer S;
|
|
6631
|
-
} ? S : TTable)
|
|
6652
|
+
} ? S : TTable)>>>;
|
|
6632
6653
|
}
|
|
6633
6654
|
declare class ConnectedUpdateBuilder<TTable = any> {
|
|
6634
6655
|
private builder;
|
|
@@ -6648,12 +6669,22 @@ declare class ConnectedUpdateBuilder<TTable = any> {
|
|
|
6648
6669
|
/**
|
|
6649
6670
|
* Set RETURNING clause - returns executor with typed run()
|
|
6650
6671
|
* Use '*' to return all columns, or specify column names
|
|
6672
|
+
* Pass null to skip RETURNING clause (useful for conditional returning)
|
|
6651
6673
|
*/
|
|
6652
|
-
returning
|
|
6674
|
+
returning(columns: null): this;
|
|
6675
|
+
returning(columns: "*"): ReturningExecutor<TTable extends {
|
|
6676
|
+
$inferSelect: infer S;
|
|
6677
|
+
} ? S : TTable>;
|
|
6678
|
+
returning<K extends string & ColumnName<TTable>>(columns: K | K[]): ReturningExecutor<Prettify<Pick<TTable extends {
|
|
6679
|
+
$inferSelect: infer S;
|
|
6680
|
+
} ? S : TTable, K & keyof (TTable extends {
|
|
6681
|
+
$inferSelect: infer S;
|
|
6682
|
+
} ? S : TTable)>>>;
|
|
6683
|
+
returning<K extends string & ColumnName<TTable>>(columns: K[] | null): this | ReturningExecutor<Prettify<Pick<TTable extends {
|
|
6653
6684
|
$inferSelect: infer S;
|
|
6654
6685
|
} ? S : TTable, K & keyof (TTable extends {
|
|
6655
6686
|
$inferSelect: infer S;
|
|
6656
|
-
} ? S : TTable)
|
|
6687
|
+
} ? S : TTable)>>>;
|
|
6657
6688
|
}
|
|
6658
6689
|
declare class PaginateBuilder<TSchema, TTable, T> {
|
|
6659
6690
|
private relq;
|
package/dist/schema-builder.d.ts
CHANGED
|
@@ -2779,9 +2779,10 @@ export type Simplify<T> = {
|
|
|
2779
2779
|
[K in keyof T]: T[K];
|
|
2780
2780
|
} & {};
|
|
2781
2781
|
/**
|
|
2782
|
-
* Clean a column type by removing DefaultValue union members
|
|
2782
|
+
* Clean a column type by removing DefaultValue union members and symbols
|
|
2783
|
+
* (symbols like EMPTY_OBJECT/EMPTY_ARRAY can leak into type inference from $default)
|
|
2783
2784
|
*/
|
|
2784
|
-
export type CleanType<T> = Exclude<T, DefaultValue | (object & DefaultValue)>;
|
|
2785
|
+
export type CleanType<T> = Exclude<T, DefaultValue | (object & DefaultValue) | symbol>;
|
|
2785
2786
|
/**
|
|
2786
2787
|
* Build SELECT type with smart required/optional:
|
|
2787
2788
|
* - Required: NOT NULL, PRIMARY KEY, has DEFAULT/GENERATED columns
|