Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 6c76c240
authored
May 29, 2019
by
dy93
Committed by
Simon Schick
May 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs(findbypk): fix document and type definition (#11005)
1 parent
30c5ca5e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
8 deletions
lib/model.js
types/lib/model.d.ts
types/lib/sequelize.d.ts
lib/model.js
View file @
6c76c24
...
@@ -1856,7 +1856,7 @@ class Model {
...
@@ -1856,7 +1856,7 @@ class Model {
* @param {string} [options.searchPath=DEFAULT] An optional parameter to specify the schema search_path (Postgres only)
* @param {string} [options.searchPath=DEFAULT] An optional parameter to specify the schema search_path (Postgres only)
*
*
* @see
* @see
* {@link Model.findAll} for a full explanation of options
* {@link Model.findAll} for a full explanation of options
, Note that options.where is not supported.
*
*
* @returns {Promise<Model>}
* @returns {Promise<Model>}
*/
*/
...
...
types/lib/model.d.ts
View file @
6c76c24
...
@@ -489,6 +489,8 @@ export interface IndexHintable {
...
@@ -489,6 +489,8 @@ export interface IndexHintable {
indexHints
?:
IndexHint
[];
indexHints
?:
IndexHint
[];
}
}
type
Omit
<
T
,
K
extends
keyof
T
>
=
Pick
<
T
,
Exclude
<
keyof
T
,
K
>>
/**
/**
* Options that are passed to any model creating a SELECT query
* Options that are passed to any model creating a SELECT query
*
*
...
@@ -1756,12 +1758,12 @@ export abstract class Model<T = any, T2 = any> extends Hooks {
...
@@ -1756,12 +1758,12 @@ export abstract class Model<T = any, T2 = any> extends Hooks {
public
static
findByPk
<
M
extends
Model
>
(
public
static
findByPk
<
M
extends
Model
>
(
this
:
{
new
():
M
}
&
typeof
Model
,
this
:
{
new
():
M
}
&
typeof
Model
,
identifier
?:
Identifier
,
identifier
?:
Identifier
,
options
?:
FindOptions
options
?:
Omit
<
FindOptions
,
'where'
>
):
Promise
<
M
|
null
>
;
):
Promise
<
M
|
null
>
;
public
static
findByPk
<
M
extends
Model
>
(
public
static
findByPk
<
M
extends
Model
>
(
this
:
{
new
():
M
}
&
typeof
Model
,
this
:
{
new
():
M
}
&
typeof
Model
,
identifier
:
Identifier
,
identifier
:
Identifier
,
options
:
NonNullFindOptions
options
:
Omit
<
NonNullFindOptions
,
'where'
>
):
Promise
<
M
>
;
):
Promise
<
M
>
;
/**
/**
...
...
types/lib/sequelize.d.ts
View file @
6c76c24
...
@@ -43,6 +43,7 @@ export interface SyncOptions extends Logging {
...
@@ -43,6 +43,7 @@ export interface SyncOptions extends Logging {
/**
/**
* If alter is true, each DAO will do ALTER TABLE ... CHANGE ...
* If alter is true, each DAO will do ALTER TABLE ... CHANGE ...
* Alters tables to fit models. Not recommended for production use. Deletes data in columns that were removed or had their type changed in the model.
*/
*/
alter
?:
boolean
;
alter
?:
boolean
;
...
@@ -66,11 +67,6 @@ export interface SyncOptions extends Logging {
...
@@ -66,11 +67,6 @@ export interface SyncOptions extends Logging {
* If hooks is true then beforeSync, afterSync, beforeBulkSync, afterBulkSync hooks will be called
* If hooks is true then beforeSync, afterSync, beforeBulkSync, afterBulkSync hooks will be called
*/
*/
hooks
?:
boolean
;
hooks
?:
boolean
;
/**
* Alters tables to fit models. Not recommended for production use. Deletes data in columns that were removed or had their type changed in the model.
*/
alter
?:
boolean
;
}
}
export
interface
DefaultSetOptions
{}
export
interface
DefaultSetOptions
{}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment