PostgreSQL

PostgreSQL

对于 PostgreSQL,需要两个库,pg@^7.0.0 和 pg-hstore. 你只需要定义方言:

const sequelize = new Sequelize('database', 'username', 'password', {
  // postgres!
  dialect: 'postgres'
})

要通过 unix 域套接字进行连接,请在 host 选项中指定套接字目录的路径.

套接字路径必须以 / 开头.

const sequelize = new Sequelize('database', 'username', 'password', {
  // postgres!
  dialect: 'postgres',
  host: '/path/to/socket_directory'
})