Upgrade to Pro — share decks privately, control downloads, hide ads and more …

sequelize.pdf

 sequelize.pdf

sequelize と sequelize-autoの紹介

Kazunori-Kimura

June 11, 2018
Tweet

More Decks by Kazunori-Kimura

Other Decks in Technology

Transcript

  1. αϯϓϧίʔυ const User = sequelize.define('user', { username: Sequelize.STRING, birthday: Sequelize.DATE

    }); sequelize.sync() .then(() => User.create({ username: 'janedoe', birthday: new Date(1980, 6, 20) })) .then(jane => { console.log(jane.toJSON()); });  
  2. αϯϓϧίʔυ const User = sequelize.define('user', { username: Sequelize.STRING, birthday: Sequelize.DATE

    }); sequelize.sync() .then(() => User.create({ username: 'janedoe', birthday: new Date(1980, 6, 20) })) .then(jane => { console.log(jane.toJSON()); });   Ϟσϧఆٛ
  3. αϯϓϧίʔυ const User = sequelize.define('user', { username: Sequelize.STRING, birthday: Sequelize.DATE

    }); sequelize.sync() .then(() => User.create({ username: 'janedoe', birthday: new Date(1980, 6, 20) })) .then(jane => { console.log(jane.toJSON()); });   ςʔϒϧ࡞੒
  4. αϯϓϧίʔυ const User = sequelize.define('user', { username: Sequelize.STRING, birthday: Sequelize.DATE

    }); sequelize.sync() .then(() => User.create({ username: 'janedoe', birthday: new Date(1980, 6, 20) })) .then(jane => { console.log(jane.toJSON()); });   Promiseϕʔε
  5. αϯϓϧίʔυ const User = sequelize.define('user', { username: Sequelize.STRING, birthday: Sequelize.DATE

    }); sequelize.sync() .then(() => User.create({ username: 'janedoe', birthday: new Date(1980, 6, 20) })) .then(jane => { console.log(jane.toJSON()); });   INSERTॲཧ
  6. αϯϓϧίʔυ const User = sequelize.define('user', { username: Sequelize.STRING, birthday: Sequelize.DATE

    }); await sequelize.sync(); const jane = await User.create({ username: 'janedoe', birthday: new Date(1980, 6, 20) }); console.log(jane.toJSON());