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 b5bec0c6
authored
Nov 27, 2015
by
Mick Hansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(sql): support nested $col, closes #4849
1 parent
e92577ee
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
3 deletions
changelog.md
lib/dialects/abstract/query-generator.js
test/integration/model.test.js
test/unit/sql/where.test.js
changelog.md
View file @
b5bec0c
# Next
# Next
-
[
FIXED
]
Model.aggregate methods now support attributes and where conditions with fields.
[
#4935
](
https://github.com/sequelize/sequelize/issues/4935
)
-
[
FIXED
]
Model.aggregate methods now support attributes and where conditions with fields.
[
#4935
](
https://github.com/sequelize/sequelize/issues/4935
)
-
[
FIXED
]
Don't overwrite options.foreignKey in associations
[
#4927
](
https://github.com/sequelize/sequelize/pull/4927
)
-
[
FIXED
]
Don't overwrite options.foreignKey in associations
[
#4927
](
https://github.com/sequelize/sequelize/pull/4927
)
-
[
FIXED
]
Support nested
`$col`
keys.
[
#4849
](
https://github.com/sequelize/sequelize/issues/4849
)
# 3.14.1
# 3.14.1
-
[
FIXED
]
Issue with transaction options leaking and certain queries running outside of the transaction connection.
-
[
FIXED
]
Issue with transaction options leaking and certain queries running outside of the transaction connection.
...
...
lib/dialects/abstract/query-generator.js
View file @
b5bec0c
...
@@ -2185,7 +2185,16 @@ var QueryGenerator = {
...
@@ -2185,7 +2185,16 @@ var QueryGenerator = {
}
else
if
(
value
&&
value
.
$raw
)
{
}
else
if
(
value
&&
value
.
$raw
)
{
value
=
value
.
$raw
;
value
=
value
.
$raw
;
}
else
if
(
value
&&
value
.
$col
)
{
}
else
if
(
value
&&
value
.
$col
)
{
value
=
value
.
$col
.
split
(
'.'
).
map
(
this
.
quoteIdentifier
.
bind
(
this
)).
join
(
'.'
);
value
=
value
.
$col
.
split
(
'.'
);
if
(
value
.
length
>
2
)
{
value
=
[
value
.
slice
(
0
,
-
1
).
join
(
'.'
),
value
[
value
.
length
-
1
]
];
}
value
=
value
.
map
(
this
.
quoteIdentifier
.
bind
(
this
)).
join
(
'.'
);
}
else
{
}
else
{
var
escapeValue
=
true
;
var
escapeValue
=
true
;
...
@@ -2225,7 +2234,16 @@ var QueryGenerator = {
...
@@ -2225,7 +2234,16 @@ var QueryGenerator = {
if
(
key
.
_isSequelizeMethod
)
{
if
(
key
.
_isSequelizeMethod
)
{
key
=
this
.
handleSequelizeMethod
(
key
);
key
=
this
.
handleSequelizeMethod
(
key
);
}
else
if
(
Utils
.
isColString
(
key
))
{
}
else
if
(
Utils
.
isColString
(
key
))
{
key
=
key
.
substr
(
1
,
key
.
length
-
2
).
split
(
'.'
).
map
(
this
.
quoteIdentifier
.
bind
(
this
)).
join
(
'.'
);
key
=
key
.
substr
(
1
,
key
.
length
-
2
).
split
(
'.'
);
if
(
key
.
length
>
2
)
{
key
=
[
key
.
slice
(
0
,
-
1
).
join
(
'.'
),
key
[
key
.
length
-
1
]
];
}
key
=
key
.
map
(
this
.
quoteIdentifier
.
bind
(
this
)).
join
(
'.'
);
prefix
=
false
;
prefix
=
false
;
}
else
{
}
else
{
key
=
this
.
quoteIdentifier
(
key
);
key
=
this
.
quoteIdentifier
(
key
);
...
...
test/integration/model.test.js
View file @
b5bec0c
...
@@ -1987,7 +1987,6 @@ describe(Support.getTestDialectTeaser('Model'), function() {
...
@@ -1987,7 +1987,6 @@ describe(Support.getTestDialectTeaser('Model'), function() {
describe
(
'sum'
,
function
()
{
describe
(
'sum'
,
function
()
{
beforeEach
(
function
()
{
beforeEach
(
function
()
{
var
self
=
this
;
this
.
UserWithAge
=
this
.
sequelize
.
define
(
'UserWithAge'
,
{
this
.
UserWithAge
=
this
.
sequelize
.
define
(
'UserWithAge'
,
{
age
:
Sequelize
.
INTEGER
,
age
:
Sequelize
.
INTEGER
,
order
:
Sequelize
.
INTEGER
,
order
:
Sequelize
.
INTEGER
,
...
...
test/unit/sql/where.test.js
View file @
b5bec0c
...
@@ -341,6 +341,12 @@ suite(Support.getTestDialectTeaser('SQL'), function() {
...
@@ -341,6 +341,12 @@ suite(Support.getTestDialectTeaser('SQL'), function() {
},
{
},
{
default
:
'[organization].[id] = [user].[organizationId]'
default
:
'[organization].[id] = [user].[organizationId]'
});
});
testsql
(
'$offer.organization.id$'
,
{
$col
:
'offer.user.organizationId'
},
{
default
:
'[offer.organization].[id] = [offer.user].[organizationId]'
});
});
});
suite
(
'$gt'
,
function
()
{
suite
(
'$gt'
,
function
()
{
...
...
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