mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-13 05:20:25 +00:00
Merge pull request #33761 from haracejacob/sequelize/whereoption
[@types/sequelize] Add where type to WhereOptions
This commit is contained in:
Vendored
+1
-1
@@ -3198,7 +3198,7 @@ declare namespace sequelize {
|
||||
*/
|
||||
type Primitives = string | number | boolean | Buffer;
|
||||
type WhereOptions<T> = {
|
||||
[P in keyof T]?: Primitives | Array<Primitives> | WhereLogic | (T[P] extends Primitives ? null : WhereOptions<T[P]>) | col | and | or | WhereGeometryOptions | WhereNested | null;
|
||||
[P in keyof T]?: Primitives | Array<Primitives> | WhereLogic | (T[P] extends Primitives ? null : WhereOptions<T[P]>) | col | and | or | WhereGeometryOptions | WhereNested | where | null;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -997,6 +997,9 @@ User.findAll( { where: { $and:[ { username: { $not: "user" } }, { theDate: new D
|
||||
User.findAll( { where: { $or:[ { username: { $not: "user" } }, { theDate: new Date() } ] } } );
|
||||
User.findAll( { where: { emails: { $overlap: ["me@mail.com", "you@mail.com"] } } } );
|
||||
|
||||
var options: Sequelize.AnyFindOptions = { where: { $and: Sequelize.where( Sequelize.fn( 'char_length', Sequelize.col('username') ), 4 ) } };
|
||||
User.findAll( options );
|
||||
|
||||
User.findById( 'a string' );
|
||||
User.findById( 42 );
|
||||
User.findById( Buffer.from('a buffer') );
|
||||
|
||||
Reference in New Issue
Block a user