query-interface.js
1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
var Utils = require('./utils')
module.exports = (function() {
var QueryInterface = function(sequelize) {
this.sequelize = sequelize
this.QueryGenerator = this.sequelize.connectorManager.getQueryGenerator()
}
QueryInterface.prototype.createTable = function(tableName, attributes, options) {
return query.call(this, this.QueryGenerator.createTableQuery(tableName, attributes, options))
}
QueryInterface.prototype.dropTable = function() {
}
QueryInterface.prototype.renameTable = function() {
}
QueryInterface.prototype.addColumn = function() {
}
QueryInterface.prototype.removeColumn = function() {
}
QueryInterface.prototype.changeColumn = function() {
}
QueryInterface.prototype.renameColumn = function() {
}
QueryInterface.prototype.addIndex = function() {
}
QueryInterface.prototype.removeIndex = function() {
}
QueryInterface.prototype.insert = function() {
}
QueryInterface.prototype.update = function() {
}
QueryInterface.prototype.destroy = 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
})()