mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 00:07:07 +00:00
Merge pull request #24442 from YaroslavRepeta/buffer-as-primary-key
[Sequelize] Add type "Buffer" as possible primary key in "findById" and its alias "findByPrimary" functions
This commit is contained in:
Vendored
+2
-2
@@ -3865,8 +3865,8 @@ declare namespace sequelize {
|
||||
* Search for a single instance by its primary key. This applies LIMIT 1, so the listener will
|
||||
* always be called with a single instance.
|
||||
*/
|
||||
findById<TCustomAttributes>(identifier?: number | string, options?: FindOptions<TAttributes & TCustomAttributes>): Promise<TInstance | null>;
|
||||
findByPrimary<TCustomAttributes>(identifier?: number | string, options?: FindOptions<TAttributes & TCustomAttributes>): Promise<TInstance | null>;
|
||||
findById<TCustomAttributes>(identifier?: number | string | Buffer, options?: FindOptions<TAttributes & TCustomAttributes>): Promise<TInstance | null>;
|
||||
findByPrimary<TCustomAttributes>(identifier?: number | string | Buffer, options?: FindOptions<TAttributes & TCustomAttributes>): Promise<TInstance | null>;
|
||||
|
||||
/**
|
||||
* Search for a single instance. This applies LIMIT 1, so the listener will always be called with a single
|
||||
|
||||
@@ -957,6 +957,12 @@ User.findAll( { where: { $or:[ { username: { $not: "user" } }, { theDate: new Da
|
||||
User.findAll( { where: { emails: { $overlap: ["me@mail.com", "you@mail.com"] } } } );
|
||||
|
||||
User.findById( 'a string' );
|
||||
User.findById( 42 );
|
||||
User.findById( Buffer.from('a buffer') );
|
||||
|
||||
User.findByPrimary( 'a string' );
|
||||
User.findByPrimary( 42 );
|
||||
User.findByPrimary( Buffer.from('a buffer') );
|
||||
|
||||
User.findOne( { where : { username : 'foo' } } );
|
||||
User.findOne( { where : { id : 1 }, attributes : ['id', ['username', 'name']] } );
|
||||
|
||||
Reference in New Issue
Block a user