Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ahilles107/1d3fd99e7b1362714de791f20793e0b2 to your computer and use it in GitHub Desktop.
Save ahilles107/1d3fd99e7b1362714de791f20793e0b2 to your computer and use it in GitHub Desktop.
const Sequelize = require('sequelize');
const sequelize = new Sequelize('heroku_94b79d07738d7b2', 'be1ac71986aa53', '9c18215d', {
host: 'us-cdbr-iron-east-03.cleardb.net',
dialect: 'mysql',
pool: {
max: 10,
min: 0,
idle: 10000
},
});
var Question = sequelize.define("quiz_questions", {
id: {
type: Sequelize.INTEGER,
autoIncrement: true,
primaryKey: true
}
});
sequelize
.authenticate()
.then(function() {
Question.findAll({
attributes: ['id']
}).then(questions => {
questions.forEach(function(question, index) {
console.log(question.dataValues);
})
});
})
.catch(function(err) {
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment