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 37f79d4f
authored
Nov 21, 2011
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
method for querying and creating tables
1 parent
f114ad3f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletions
lib/query-interface.js
lib/query-interface.js
View file @
37f79d4
var
Utils
=
require
(
'./utils'
)
module
.
exports
=
(
function
()
{
var
QueryInterface
=
function
(
sequelize
)
{
this
.
sequelize
=
sequelize
}
QueryInterface
.
prototype
.
createTable
=
function
()
{
QueryInterface
.
prototype
.
__defineGetter__
(
'QueryGenerator'
,
function
()
{
return
this
.
sequelize
.
connectorManager
.
getQueryGenerator
()
})
QueryInterface
.
prototype
.
createTable
=
function
(
tableName
,
attributes
,
options
)
{
var
self
=
this
return
query
.
call
(
this
,
this
.
QueryGenerator
.
createTableQuery
(
tableName
,
attributes
,
options
))
}
QueryInterface
.
prototype
.
dropTable
=
function
()
{
...
...
@@ -51,5 +59,16 @@ module.exports = (function() {
}
// private
var
query
=
function
()
{
var
args
=
Utils
.
_
.
map
(
arguments
,
function
(
arg
,
_
)
{
return
arg
})
// add this as the second argument
if
(
arguments
.
length
==
1
)
args
.
push
(
this
)
return
this
.
sequelize
.
query
.
apply
(
this
.
sequelize
,
args
)
}
return
QueryInterface
})()
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