Created
July 20, 2017 21:28
-
-
Save ahilles107/1d3fd99e7b1362714de791f20793e0b2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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