Created
April 24, 2014 17:28
-
-
Save SinisterMinister/11262663 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
var Intaglio = require('intaglio'), | |
repository = new Intaglio.repositories.mysql({ | |
host: 'localhost', | |
database: 'database', | |
user: 'username', | |
password: 'password' | |
}); | |
Intaglio.ORM.create(repository).then(function (ORM) { | |
ORM.factory('user').create({ | |
username: 'sdepold', | |
birthday: new Date(1986, 06, 28) | |
}).save().then(function (sdepold) { | |
console.log(sdepold.getData()); | |
}) | |
}); |
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
var Sequelize = require('sequelize') | |
, sequelize = new Sequelize('database', 'username', 'password') | |
var User = sequelize.define('User', { | |
username: Sequelize.STRING, | |
birthday: Sequelize.DATE | |
}) | |
sequelize.sync().success(function() { | |
User.create({ | |
username: 'sdepold', | |
birthday: new Date(1986, 06, 28) | |
}).success(function(sdepold) { | |
console.log(sdepold.values) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment