relq 1.0.117 → 1.0.118
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.
|
@@ -234,6 +234,9 @@ class ConditionCollector {
|
|
|
234
234
|
const subquery = values(this._tables);
|
|
235
235
|
this.conditions.push({ method: 'in', column, values: subquery.toString() });
|
|
236
236
|
}
|
|
237
|
+
else if (!Array.isArray(values) && typeof values === 'object' && values !== null && 'toString' in values) {
|
|
238
|
+
this.conditions.push({ method: 'in', column, values: values.toString() });
|
|
239
|
+
}
|
|
237
240
|
else {
|
|
238
241
|
this.conditions.push({ method: 'in', column, values });
|
|
239
242
|
}
|
|
@@ -244,6 +247,9 @@ class ConditionCollector {
|
|
|
244
247
|
const subquery = values(this._tables);
|
|
245
248
|
this.conditions.push({ method: 'notIn', column, values: subquery.toString() });
|
|
246
249
|
}
|
|
250
|
+
else if (!Array.isArray(values) && typeof values === 'object' && values !== null && 'toString' in values) {
|
|
251
|
+
this.conditions.push({ method: 'notIn', column, values: values.toString() });
|
|
252
|
+
}
|
|
247
253
|
else {
|
|
248
254
|
this.conditions.push({ method: 'notIn', column, values });
|
|
249
255
|
}
|
|
@@ -226,6 +226,9 @@ export class ConditionCollector {
|
|
|
226
226
|
const subquery = values(this._tables);
|
|
227
227
|
this.conditions.push({ method: 'in', column, values: subquery.toString() });
|
|
228
228
|
}
|
|
229
|
+
else if (!Array.isArray(values) && typeof values === 'object' && values !== null && 'toString' in values) {
|
|
230
|
+
this.conditions.push({ method: 'in', column, values: values.toString() });
|
|
231
|
+
}
|
|
229
232
|
else {
|
|
230
233
|
this.conditions.push({ method: 'in', column, values });
|
|
231
234
|
}
|
|
@@ -236,6 +239,9 @@ export class ConditionCollector {
|
|
|
236
239
|
const subquery = values(this._tables);
|
|
237
240
|
this.conditions.push({ method: 'notIn', column, values: subquery.toString() });
|
|
238
241
|
}
|
|
242
|
+
else if (!Array.isArray(values) && typeof values === 'object' && values !== null && 'toString' in values) {
|
|
243
|
+
this.conditions.push({ method: 'notIn', column, values: values.toString() });
|
|
244
|
+
}
|
|
239
245
|
else {
|
|
240
246
|
this.conditions.push({ method: 'notIn', column, values });
|
|
241
247
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -919,13 +919,19 @@ export interface TypedConditionBuilder<TTable = any> {
|
|
|
919
919
|
lessThanOrEqual<K extends ColumnName<TTable>>(column: K, value: ConditionValue<TTable, K>): TypedConditionBuilder<TTable>;
|
|
920
920
|
/** Alias for isNotNull - creates an IS NOT NULL condition */
|
|
921
921
|
notNull<K extends ColumnName<TTable>>(column: K): TypedConditionBuilder<TTable>;
|
|
922
|
-
/** Creates an IN condition for array matching or subquery */
|
|
922
|
+
/** Creates an IN condition for array matching, subquery builder, or subquery callback */
|
|
923
923
|
in<K extends ColumnName<TTable>>(column: K, values: ConditionValue<TTable, K>[]): TypedConditionBuilder<TTable>;
|
|
924
|
+
in<K extends ColumnName<TTable>>(column: K, subquery: {
|
|
925
|
+
toString(): string;
|
|
926
|
+
}): TypedConditionBuilder<TTable>;
|
|
924
927
|
in<K extends ColumnName<TTable>>(column: K, subquery: (t: any) => {
|
|
925
928
|
toString(): string;
|
|
926
929
|
}): TypedConditionBuilder<TTable>;
|
|
927
|
-
/** Creates a NOT IN condition for array exclusion or subquery */
|
|
930
|
+
/** Creates a NOT IN condition for array exclusion, subquery builder, or subquery callback */
|
|
928
931
|
notIn<K extends ColumnName<TTable>>(column: K, values: ConditionValue<TTable, K>[]): TypedConditionBuilder<TTable>;
|
|
932
|
+
notIn<K extends ColumnName<TTable>>(column: K, subquery: {
|
|
933
|
+
toString(): string;
|
|
934
|
+
}): TypedConditionBuilder<TTable>;
|
|
929
935
|
notIn<K extends ColumnName<TTable>>(column: K, subquery: (t: any) => {
|
|
930
936
|
toString(): string;
|
|
931
937
|
}): TypedConditionBuilder<TTable>;
|