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

Commit 7bce9dcb by Sascha Depold

fix for #1077

1 parent 27dbf0fd
......@@ -57,7 +57,7 @@ module.exports = (function() {
}
var onSuccess = function(rows, sql) {
var results = []
var results = rows
, self = this
, isTableNameQuery = (sql.indexOf('SELECT table_name FROM information_schema.tables') === 0)
, isRelNameQuery = (sql.indexOf('SELECT relname FROM pg_class WHERE oid IN') === 0)
......
......@@ -262,6 +262,18 @@ describe(Support.getTestDialectTeaser("Sequelize"), function () {
done()
})
})
if (Support.getTestDialect() === 'postgres') {
it('supports WITH queries', function(done) {
this
.sequelize
.query("WITH RECURSIVE t(n) AS ( VALUES (1) UNION ALL SELECT n+1 FROM t WHERE n < 100) SELECT sum(n) FROM t")
.success(function(results) {
expect(results).to.deep.equal([ { "sum": "5050" } ])
done()
})
})
}
})
describe('define', function() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!