🐛 Fix ORM query builder with $in option for postgres (#771)
This commit is contained in:
+10
@@ -93,6 +93,16 @@ describe('The PostgresQueryBuilder', () => {
|
||||
expect(query[1]).toEqual(options.$in[0][1]);
|
||||
});
|
||||
|
||||
test('buildSelect query "in" options with empty array', async () => {
|
||||
//given
|
||||
const options = { $in: [["added", []] as comparisonType] };
|
||||
|
||||
// When & Then
|
||||
expect(() => {
|
||||
subj.buildSelect(TestDbEntity, null, options);
|
||||
}).toThrowError("The $in operator for column 'added' requires a non-empty array of values.");
|
||||
});
|
||||
|
||||
test('buildSelect query "like" options', async () => {
|
||||
//given
|
||||
const options = { $like: [["id", randomUUID()] as comparisonType, ["company_id", randomUUID()] as comparisonType]};
|
||||
|
||||
Reference in New Issue
Block a user