File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -1661,6 +1661,16 @@ export abstract class Model {
16611661 identifier : number | string ,
16621662 options : NonNullFindOptions
16631663 ) : Promise < M >
1664+ public static findByPk < M extends Model > (
1665+ this : { new ( ) : M } & typeof Model ,
1666+ identifier ?: number | string ,
1667+ options ?: FindOptions
1668+ ) : Promise < M | null >
1669+ public static findByPk < M extends Model > (
1670+ this : { new ( ) : M } & typeof Model ,
1671+ identifier : number | string ,
1672+ options : NonNullFindOptions
1673+ ) : Promise < M >
16641674
16651675 /**
16661676 * Search for a single instance. This applies LIMIT 1, so the listener will always be called with a single
Original file line number Diff line number Diff line change @@ -17,4 +17,5 @@ async function test(): Promise<void> {
1717
1818 const user2 = await User . create ( { firstName : 'John' , groupId : 1 } )
1919 await User . findAndCountAll ( { distinct : true } )
20+ await User . findByPk ( 1 )
2021}
You can’t perform that action at this time.
0 commit comments