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 a676eea0
authored
Mar 30, 2019
by
Justin Abene
Committed by
Sushant
Mar 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(typings): upsert options (#10655)
1 parent
ea5afbfd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
4 deletions
types/lib/model.d.ts
types/test/upsert.ts
types/lib/model.d.ts
View file @
a676eea
...
@@ -559,14 +559,24 @@ export interface FindOrCreateOptions extends Logging, Transactionable {
...
@@ -559,14 +559,24 @@ export interface FindOrCreateOptions extends Logging, Transactionable {
*/
*/
export
interface
UpsertOptions
extends
Logging
,
Transactionable
,
SearchPathable
{
export
interface
UpsertOptions
extends
Logging
,
Transactionable
,
SearchPathable
{
/**
/**
*
Run validations before the row is inserted
*
The fields to insert / update. Defaults to all fields
*/
*/
validate
?:
boolean
;
fields
?:
string
[]
;
/**
/**
*
The fields to insert / update. Defaults to all fields
*
Run before / after bulk create hooks?
*/
*/
fields
?:
string
[];
hooks
?:
boolean
;
/**
* Return the affected rows (only for postgres)
*/
returning
?:
boolean
;
/**
* Run validations before the row is inserted
*/
validate
?:
boolean
;
}
}
/**
/**
...
...
types/test/upsert.ts
0 → 100644
View file @
a676eea
import
{
Model
}
from
"sequelize"
import
{
sequelize
}
from
'./connection'
;
class
TestModel
extends
Model
{
}
TestModel
.
init
({},
{
sequelize
})
sequelize
.
transaction
(
trx
=>
{
return
TestModel
.
upsert
({},
{
benchmark
:
true
,
fields
:
[
'testField'
],
hooks
:
true
,
logging
:
true
,
returning
:
true
,
searchPath
:
'DEFAULT'
,
transaction
:
trx
,
validate
:
true
,
})
})
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