Merge pull request #32706 from YaroslavRepeta/buffer-in-where-clause

[Sequelize] Buffer/Buffer[]/boolean[] in where clause
This commit is contained in:
Armando Aguirre
2019-02-04 17:15:58 -08:00
committed by GitHub
2 changed files with 5 additions and 1 deletions
+2 -1
View File
@@ -3187,8 +3187,9 @@ declare namespace sequelize {
* We did put Object in the end, because there where query might be a JSON Blob. It cripples a bit the
* typesafety, but there is no way to pass the tests if we just remove it.
*/
type Primitives = string | number | boolean | Buffer;
type WhereOptions<T> = {
[P in keyof T]?: string | number | boolean | WhereLogic | WhereOptions<T[P]> | col | and | or | WhereGeometryOptions | WhereNested | Array<string | number> | null;
[P in keyof T]?: Primitives | Array<Primitives> | WhereLogic | (T[P] extends Primitives ? null : WhereOptions<T[P]>) | col | and | or | WhereGeometryOptions | WhereNested | null;
};
/**
+3
View File
@@ -922,6 +922,9 @@ User.findAll( { include : [{ model : Task, paranoid: false }] } );
User.findAll( { transaction : t } );
User.findAll( { where : { data : { name : { last : 's' }, employment : { $ne : 'a' } } }, order : [['id', 'ASC']] } );
User.findAll( { where : { username : ['boo', 'boo2'] } } );
User.findAll( { where : { username : Buffer.from("a name") } } );
User.findAll( { where : { username : [Buffer.from("a name")] } } );
User.findAll( { where : { username : [true] } } );
User.findAll( { where : { username : { like : '%2' } } } );
User.findAll( { where : { theDate : { '..' : ['2013-01-02', '2013-01-11'] } } } );
User.findAll( { where : { intVal : { '!..' : [8, 10] } } } );