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 76c5ac79
authored
Jan 05, 2012
by
sdepold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added abstract query class
1 parent
7a1e992c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
12 deletions
lib/dialects/mysql/query.js
lib/dialects/query.js
lib/dialects/sqlite/query.js
lib/dialects/mysql/query.js
View file @
76c5ac7
...
...
@@ -14,7 +14,7 @@ module.exports = (function() {
this
.
bindClientFunction
=
function
(
err
)
{
onFailure
.
call
(
self
,
err
)
}
}
Utils
.
addEventEmitter
(
Query
)
Utils
.
_
.
extend
(
Query
.
prototype
,
require
(
"../query"
).
prototype
)
Query
.
prototype
.
run
=
function
(
sql
)
{
var
self
=
this
...
...
@@ -33,16 +33,6 @@ module.exports = (function() {
return
this
}
Query
.
prototype
.
success
=
Query
.
prototype
.
ok
=
function
(
fct
)
{
this
.
on
(
'success'
,
fct
)
return
this
}
Query
.
prototype
.
failure
=
Query
.
prototype
.
fail
=
Query
.
prototype
.
error
=
function
(
fct
)
{
this
.
on
(
'failure'
,
fct
)
return
this
}
//private
var
bindClient
=
function
()
{
...
...
lib/dialects/query.js
0 → 100644
View file @
76c5ac7
var
Utils
=
require
(
"../utils"
)
module
.
exports
=
(
function
()
{
var
Query
=
function
(
database
,
callee
,
options
)
{
throw
new
Error
(
'Constructor was not overwritten!'
)
}
Utils
.
addEventEmitter
(
Query
)
Query
.
prototype
.
run
=
function
(
sql
)
{
throw
new
Error
(
"The run method wasn't overwritten!"
)
}
Query
.
prototype
.
success
=
Query
.
prototype
.
ok
=
function
(
fct
)
{
this
.
on
(
'success'
,
fct
)
return
this
}
Query
.
prototype
.
failure
=
Query
.
prototype
.
fail
=
Query
.
prototype
.
error
=
function
(
fct
)
{
this
.
on
(
'failure'
,
fct
)
return
this
}
return
Query
})()
lib/dialects/sqlite/query.js
View file @
76c5ac7
...
...
@@ -12,7 +12,7 @@ module.exports = (function() {
raw
:
false
},
options
||
{})
}
Utils
.
addEventEmitter
(
Query
)
Utils
.
_
.
extend
(
Query
.
prototype
,
require
(
"../query"
).
prototype
)
Query
.
prototype
.
run
=
function
(
sql
)
{
var
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