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 @@ -914,7 +914,14 @@ export class SequelizeCrudRepository<
914
914
[ 'Array' , 'array' ] . includes ( definition [ propName ] . type . toString ( ) )
915
915
) {
916
916
// Postgres only
917
- dataType = DataTypes . ARRAY ( DataTypes . INTEGER ) ;
917
+ const stringTypeArray =
918
+ definition [ propName ] . itemType === String ||
919
+ [ 'String' , 'string' ] . includes (
920
+ definition [ propName ] . itemType ?. toString ( ) || '' ,
921
+ ) ;
922
+ dataType = stringTypeArray
923
+ ? DataTypes . ARRAY ( DataTypes . STRING )
924
+ : DataTypes . ARRAY ( DataTypes . INTEGER ) ;
918
925
}
919
926
920
927
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