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 c75ff9ef
authored
Oct 07, 2012
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use the db method getter
1 parent
b968ba36
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
lib/dialects/sqlite/query.js
lib/dialects/sqlite/query.js
View file @
c75ff9e
...
@@ -28,7 +28,7 @@ module.exports = (function() {
...
@@ -28,7 +28,7 @@ module.exports = (function() {
var
columnTypes
=
{};
var
columnTypes
=
{};
this
.
database
.
serialize
(
function
()
{
this
.
database
.
serialize
(
function
()
{
var
executeSql
=
function
()
{
var
executeSql
=
function
()
{
self
.
database
[
databaseMethod
](
self
.
sql
,
function
(
err
,
results
)
{
self
.
database
[
getDatabaseMethod
.
call
(
self
)
](
self
.
sql
,
function
(
err
,
results
)
{
//allow clients to listen to sql to do their own logging or whatnot
//allow clients to listen to sql to do their own logging or whatnot
self
.
emit
(
'sql'
,
self
.
sql
)
self
.
emit
(
'sql'
,
self
.
sql
)
this
.
columnTypes
=
columnTypes
;
this
.
columnTypes
=
columnTypes
;
...
@@ -36,11 +36,7 @@ module.exports = (function() {
...
@@ -36,11 +36,7 @@ module.exports = (function() {
})
})
};
};
var
isInsertCommand
=
(
self
.
sql
.
toLowerCase
().
indexOf
(
'insert'
)
==
0
)
if
(
getDatabaseMethod
.
call
(
self
)
===
'all'
&&
/select
\s
.*
?\s
from
\s
+
([^
;
]
+
)
/i
.
test
(
self
.
sql
))
{
,
isUpdateCommand
=
(
self
.
sql
.
toLowerCase
().
indexOf
(
'update'
)
==
0
)
,
databaseMethod
=
(
isInsertCommand
||
isUpdateCommand
)
?
'run'
:
'all'
if
(
databaseMethod
===
'all'
&&
/select
\s
.*
?\s
from
\s
+
([^
;
]
+
)
/i
.
test
(
self
.
sql
))
{
var
tableName
=
RegExp
.
$1
;
var
tableName
=
RegExp
.
$1
;
if
(
tableName
!==
'sqlite_master'
)
{
if
(
tableName
!==
'sqlite_master'
)
{
// get the column types
// get the column types
...
@@ -65,7 +61,6 @@ module.exports = (function() {
...
@@ -65,7 +61,6 @@ module.exports = (function() {
//private
//private
var
onSuccess
=
function
(
results
,
metaData
)
{
var
getDatabaseMethod
=
function
()
{
var
getDatabaseMethod
=
function
()
{
if
(
this
.
send
(
'isInsertQuery'
)
||
this
.
send
(
'isUpdateQuery'
))
{
if
(
this
.
send
(
'isInsertQuery'
)
||
this
.
send
(
'isUpdateQuery'
))
{
return
'run'
return
'run'
...
@@ -74,6 +69,7 @@ module.exports = (function() {
...
@@ -74,6 +69,7 @@ module.exports = (function() {
}
}
}
}
var
onSuccess
=
function
(
results
,
metaData
)
{
var
result
=
this
.
callee
var
result
=
this
.
callee
,
self
=
this
,
self
=
this
...
...
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