Created
March 22, 2012 06:59
-
-
Save musubu/2156761 to your computer and use it in GitHub Desktop.
use raw query with sequelize
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Sequelize = require('Sequelize'); | |
var sequelize = new Sequelize('dbname', 'username', 'password'); | |
sequelize.connectorManager.client.query('select * from tablename', function(err, results) { | |
if (!err) { | |
console.log(results); | |
// you'll get an array of objects | |
// [{id: 1, ...}, {id: 2, ...}] | |
} else { | |
console.log(err); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment