File tree 3 files changed +13
-2
lines changed
extensions/sequelize/src/sequelize
3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -29,4 +29,6 @@ export const operatorTranslations: {
29
29
regexp : Op . regexp ,
30
30
and : Op . and ,
31
31
or : Op . or ,
32
+ match : Op . match ,
33
+ contains : Op . contains ,
32
34
} ;
Original file line number Diff line number Diff line change @@ -899,7 +899,14 @@ export class SequelizeCrudRepository<
899
899
[ 'Array' , 'array' ] . includes ( definition [ propName ] . type . toString ( ) )
900
900
) {
901
901
// Postgres only
902
- dataType = DataTypes . ARRAY ( DataTypes . INTEGER ) ;
902
+ const stringTypeArray =
903
+ definition [ propName ] . itemType === String ||
904
+ [ 'String' , 'string' ] . includes (
905
+ definition [ propName ] . itemType ?. toString ( ) || '' ,
906
+ ) ;
907
+ dataType = stringTypeArray
908
+ ? DataTypes . ARRAY ( DataTypes . STRING )
909
+ : DataTypes . ARRAY ( DataTypes . INTEGER ) ;
903
910
}
904
911
905
912
if (
Original file line number Diff line number Diff line change @@ -39,7 +39,9 @@ export type Operators =
39
39
| 'nlike' // NOT LIKE
40
40
| 'ilike' // ILIKE'
41
41
| 'nilike' // NOT ILIKE
42
- | 'regexp' ; // REGEXP'
42
+ | 'regexp' // REGEXP'
43
+ | 'match' // match
44
+ | 'contains' ; // for array
43
45
44
46
/**
45
47
* Matching predicate comparison
You can’t perform that action at this time.
0 commit comments