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 74bb3b67
authored
Oct 06, 2012
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
an abstract query
1 parent
a698f66c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
0 deletions
lib/dialects/abstract/query.js
lib/dialects/abstract/query.js
0 → 100644
View file @
74bb3b6
var
Utils
=
require
(
'../../utils'
)
,
CustomEventEmitter
=
require
(
"../../emitters/custom-event-emitter"
)
module
.
exports
=
(
function
()
{
var
AbstractQuery
=
function
(
database
,
sequelize
,
callee
,
options
)
{
}
/**
Inherit from CustomEventEmitter
*/
Utils
.
inherit
(
AbstractQuery
,
CustomEventEmitter
)
/**
* Execute the passed sql query.
*
* Examples:
*
* query.run('SELECT 1')
*
* @param {String} sql - The SQL query which should be executed.
* @api public
*/
AbstractQuery
.
prototype
.
run
=
function
(
sql
)
{
throw
new
Error
(
"The run method wasn't overwritten!"
)
}
AbstractQuery
.
prototype
.
formatResults
=
function
()
{
this
.
emit
(
'fnord'
,
1
)
}
/**
Shortcut methods (success, ok) for listening for success events.
Params:
- fct: A function that gets executed once the *success* event was triggered.
Result:
The function returns the instance of the query.
*/
AbstractQuery
.
prototype
.
success
=
AbstractQuery
.
prototype
.
ok
=
function
(
fct
)
{
this
.
on
(
'success'
,
fct
)
return
this
}
/**
Shortcut methods (failure, fail, error) for listening for error events.
Params:
- fct: A function that gets executed once the *error* event was triggered.
Result:
The function returns the instance of the query.
*/
AbstractQuery
.
prototype
.
failure
=
AbstractQuery
.
prototype
.
fail
=
AbstractQuery
.
prototype
.
error
=
function
(
fct
)
{
this
.
on
(
'error'
,
fct
)
return
this
}
return
AbstractQuery
})()
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