2022/03/04 Sequelize 모델과 데이터베이스 생성
2022. 3. 4. 14:29ㆍProject : Music Flower
[ORM] 📚 시퀄라이즈 - 모델(테이블) 정의하기
Mysql 테이블 생성 구문 create schema `nodejs` default character set utf8; use nodejs; drop table if exists comments; drop table if exists users; create table nodejs.users ( id int not null primary..
inpa.tistory.com
https://lgphone.tistory.com/86
Node.js - 시퀄라이즈 (Sequelize, SQL 데이터베이스 작업 라이브러리)
노드에서 MySQL 작업을 쉽게 할 수 있도록 도와주는 라이브러리가 있다. 바로 시퀄라이즈 (Sequelize) 이다. 시퀄라이즈는 ORM (Object-relational Mapping) 으로 분류되며, ORM은 자바스크립트 객체와 데이터
lgphone.tistory.com
mySQL 자동 연결
const { sequelize } = require('./models'); // db.sequelize
sequelize.sync({ force: false })
.then(() => {
console.log('데이터베이스 연결됨.');
}).catch((err) => {
console.error(err);
});'Project : Music Flower' 카테고리의 다른 글
| 2022/03/06 sequelize timestamp (0) | 2022.03.06 |
|---|---|
| 2022/03/05 다대다 테이블 설정 (0) | 2022.03.05 |
| 2022/03/04 DB 스키마 수정 (0) | 2022.03.04 |
| 2022/03/03 Route, Controller 구현 (0) | 2022.03.03 |
| 2022/03/03 Sequelize로 DB 구현 (0) | 2022.03.03 |