mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 07:47:04 +00:00
Merge pull request #30380 from weagle08/master
Sequelize - added findByPk to Model def
This commit is contained in:
Vendored
+1
@@ -3908,6 +3908,7 @@ declare namespace sequelize {
|
||||
*/
|
||||
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>;
|
||||
findByPk<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
|
||||
|
||||
@@ -981,6 +981,10 @@ User.findByPrimary( 'a string' );
|
||||
User.findByPrimary( 42 );
|
||||
User.findByPrimary( Buffer.from('a buffer') );
|
||||
|
||||
User.findByPk( 'a string' );
|
||||
User.findByPk( 42 );
|
||||
User.findByPk( Buffer.from('a buffer') );
|
||||
|
||||
User.findOne( { where : { username : 'foo' } } );
|
||||
User.findOne( { where : { id : 1 }, attributes : ['id', ['username', 'name']] } );
|
||||
User.findOne( { where : { id : 1 }, attributes : ['id'] } );
|
||||
|
||||
Reference in New Issue
Block a user