상세 컨텐츠

본문 제목

node -> typeorm

node

by RNDK 2023. 1. 19. 10:55

본문

 typeorm 이란?

 

 -> 노드에서 실행되고 typescript로 작성된 객체 관계형 매퍼 라이브러리이다.

-> mysql, postgresql, mariadb, 등 여러 데이터베이스를 지원한다.

 

설치 방법

 - > npx typeorm init

 

설정 방법

 export const AppDataSource = new DataSource({

type: "postgres",
host: "localhost",
port: 5432,
username: "postgres",
password: "password",
database: "postgres",
synchronize: true,
logging: false,
entities: ["src/entity/**/*.ts"],
migrations: [],
subscribers: [],
});

appDataSource를 docker-compose에 맞춰서 username, password, database, port를 설정해준다.

'node' 카테고리의 다른 글

cookie serializeOption  (0) 2023.01.25
jsonwebtoken & cookie (with typescript)  (0) 2023.01.25
jsonwebtoken & cookie (with typescript)  (0) 2023.01.20
node -> typeorm2(entity)  (0) 2023.01.19
node 설정 방법 (with typescript)  (0) 2023.01.19

관련글 더보기

댓글 영역