const { User } =require('./models').User;// 메서드들은 다 promise이기 때문에 앞에 await이나 뒤에 then을 붙여줘야한다.User.create({ name:'adam', age:29, married:false, comment:'자기소개1',}).then((result) => {console.log(result); }).catch((err) => {console.error(err); });
Select *FROMnodejs.users;User.findAll({})
SELECT name, married FROMnodejs.users;User.findAll({ attributes: ['name','married']})