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 87420b47
authored
May 06, 2014
by
Joshua Perry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix sqlite double-quoting
1 parent
640e1eca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
lib/dialects/sqlite/query-generator.js
test/dao-factory.test.js
lib/dialects/sqlite/query-generator.js
View file @
87420b4
...
...
@@ -31,7 +31,7 @@ module.exports = (function() {
return
tableName
}
return
this
.
quoteIdentifier
(
schema
)
+
(
!
schemaDelimiter
?
'.'
:
schemaDelimiter
)
+
this
.
quoteIdentifier
(
tableName
)
return
this
.
quoteIdentifier
(
schema
+
(
!
schemaDelimiter
?
'.'
:
schemaDelimiter
)
+
tableName
)
},
createSchema
:
function
()
{
...
...
@@ -325,7 +325,7 @@ module.exports = (function() {
},
showIndexQuery
:
function
(
tableName
)
{
var
sql
=
"PRAGMA INDEX_LIST(
'<%= tableName %>'
)"
var
sql
=
"PRAGMA INDEX_LIST(
<%= tableName %>
)"
return
Utils
.
_
.
template
(
sql
,
{
tableName
:
tableName
})
},
...
...
@@ -345,7 +345,7 @@ module.exports = (function() {
options
.
schema
=
schema
||
null
options
.
schemaDelimiter
=
schemaDelimiter
||
null
var
sql
=
"PRAGMA TABLE_INFO(
'<%= tableName %>'
);"
var
sql
=
"PRAGMA TABLE_INFO(
<%= tableName %>
);"
return
Utils
.
_
.
template
(
sql
,
{
tableName
:
this
.
addSchema
({
tableName
:
tableName
,
options
:
options
})})
},
...
...
@@ -440,7 +440,8 @@ module.exports = (function() {
* @return {String} The generated sql query.
*/
getForeignKeysQuery
:
function
(
tableName
,
schemaName
)
{
return
"PRAGMA foreign_key_list(\""
+
tableName
+
"\")"
var
sql
=
"PRAGMA foreign_key_list(<%= tableName %>)"
return
Utils
.
_
.
template
(
sql
,
{
tableName
:
tableName
})
}
}
...
...
test/dao-factory.test.js
View file @
87420b4
...
...
@@ -1504,7 +1504,7 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
expect
(
UserSpecial
.
indexOf
(
'INSERT INTO "special"."UserSpecials"'
)).
to
.
be
.
above
(
-
1
)
expect
(
UserPublic
.
indexOf
(
'INSERT INTO "UserPublics"'
)).
to
.
be
.
above
(
-
1
)
}
else
if
(
dialect
===
"sqlite"
)
{
expect
(
self
.
UserSpecialSync
.
getTableName
()).
to
.
equal
(
'`special
`.`
UserSpecials`'
);
expect
(
self
.
UserSpecialSync
.
getTableName
()).
to
.
equal
(
'`special
.
UserSpecials`'
);
expect
(
UserSpecial
.
indexOf
(
'INSERT INTO `special.UserSpecials`'
)).
to
.
be
.
above
(
-
1
)
expect
(
UserPublic
.
indexOf
(
'INSERT INTO `UserPublics`'
)).
to
.
be
.
above
(
-
1
)
}
else
{
...
...
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