不要怂,就是干,撸起袖子干!

Commit fd713d59 by Sascha Depold

entry point for syntax sugar

1 parent 0749e113
Showing with 7 additions and 4 deletions
......@@ -2,7 +2,7 @@ var Utils = require("./utils")
, DAO = require("./dao")
, DataTypes = require("./data-types")
, Util = require('util')
, Sql = require("sql")
, sql = require('sql')
module.exports = (function() {
var DAOFactory = function(name, attributes, options) {
......@@ -520,9 +520,12 @@ module.exports = (function() {
return this.QueryInterface.describeTable(this.tableName)
}
DAOFactory.prototype.query = function() {
var dialect = this.daoFactoryManager.sequelize.options.dialect
, instance = new Sql(dialect).define({ name: this.tableName, model: this })
DAOFactory.prototype.dataset = function() {
if (!this.__sql) {
this.__sql = sql.setDialect(this.daoFactoryManager.sequelize.options.dialect)
}
var instance = this.__sql.define({ name: this.tableName, columns: [] })
, attributes = this.attributes
Object.keys(attributes).forEach(function(key) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!