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 d5667e03
authored
Aug 29, 2019
by
Jordan
Committed by
Sushant
Aug 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(types): change raw query return type to [unknown[],unknown] (#11368)
1 parent
398ae593
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
types/lib/sequelize.d.ts
types/test/sequelize.ts
types/lib/sequelize.d.ts
View file @
d5667e0
...
@@ -1185,7 +1185,7 @@ export class Sequelize extends Hooks {
...
@@ -1185,7 +1185,7 @@ export class Sequelize extends Hooks {
options
:
QueryOptionsWithModel
options
:
QueryOptionsWithModel
):
Promise
<
M
[]
>
;
):
Promise
<
M
[]
>
;
public
query
<
T
extends
object
>
(
sql
:
string
|
{
query
:
string
;
values
:
unknown
[]
},
options
:
QueryOptionsWithType
<
QueryTypes
.
SELECT
>
):
Promise
<
T
[]
>
;
public
query
<
T
extends
object
>
(
sql
:
string
|
{
query
:
string
;
values
:
unknown
[]
},
options
:
QueryOptionsWithType
<
QueryTypes
.
SELECT
>
):
Promise
<
T
[]
>
;
public
query
(
sql
:
string
|
{
query
:
string
;
values
:
unknown
[]
},
options
?:
QueryOptions
|
QueryOptionsWithType
<
QueryTypes
.
RAW
>
):
Promise
<
unknown
[
]
>
;
public
query
(
sql
:
string
|
{
query
:
string
;
values
:
unknown
[]
},
options
?:
QueryOptions
|
QueryOptionsWithType
<
QueryTypes
.
RAW
>
):
Promise
<
[
unknown
[],
unknown
]
>
;
/**
/**
* Get the fn for random based on the dialect
* Get the fn for random based on the dialect
...
...
types/test/sequelize.ts
View file @
d5667e0
import
{
Config
,
Sequelize
,
Model
}
from
'sequelize'
;
import
{
Config
,
Sequelize
,
Model
,
QueryTypes
}
from
'sequelize'
;
import
{
Fn
}
from
'../lib/utils'
;
import
{
Fn
}
from
'../lib/utils'
;
Sequelize
.
useCLS
({
Sequelize
.
useCLS
({
...
@@ -53,4 +53,10 @@ class Model1 extends Model{}
...
@@ -53,4 +53,10 @@ class Model1 extends Model{}
class
Model2
extends
Model
{}
class
Model2
extends
Model
{}
const
myModel
:
typeof
Model1
=
sequelize
.
models
.
asd
;
const
myModel
:
typeof
Model1
=
sequelize
.
models
.
asd
;
myModel
.
hasOne
(
Model2
)
myModel
.
hasOne
(
Model2
)
myModel
.
findAll
();
myModel
.
findAll
();
\ No newline at end of file
sequelize
.
query
(
'SELECT * FROM `user`'
,
{
type
:
QueryTypes
.
RAW
}).
then
(
result
=>
{
const
data
=
result
[
0
];
const
arraysOnly
=
(
a
:
any
[])
=>
a
;
arraysOnly
(
data
);
});
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