以下の内容はhttps://uga-box.hatenablog.com/entry/2020/09/17/000000より取得しました。


【Sequelize】SequelizeでPostgresqlに接続する

PromiseベースのNode.js ORMのSequelizeを使ってPostgresqlに接続してみる sequelize.org

$ npm install sequelize
$ npm install pg pg-hstore

DB接続

import { Sequelize } from 'sequelize';

const sequelize = new Sequelize('postgres://user:pass@example.com:5432/dbname')

検証

.authenticate()を使うと接続ができているかが確認できる

try {
  await sequelize.authenticate();
  console.log('Connection has been established successfully.');
} catch (error) {
  console.error('Unable to connect to the database:', error);
}



以上の内容はhttps://uga-box.hatenablog.com/entry/2020/09/17/000000より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14