command to make a new model in sequelize
npx sequelize-cli model:generate --name User --attributes firstName:string,lastName:string,email:string
command to make a new model in sequelize
npx sequelize-cli model:generate --name User --attributes firstName:string,lastName:string,email:string
sequelize init connection set up nodejs node
const Sequelize = require('sequelize');
const path = 'mysql://user12:12user@localhost:3306/testdb';
const sequelize = new Sequelize(path, { operatorsAliases: false });
sequelize.authenticate().then(() => {
console.log('Connection established successfully.');
}).catch(err => {
console.error('Unable to connect to the database:', err);
}).finally(() => {
sequelize.close();
});
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us