sequelize sqlite

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2021-04-20 01:00:00 +00:00
parent 461aa04b8b
commit 64e8add2b8
7 changed files with 1287 additions and 11 deletions

View File

@@ -17,11 +17,19 @@ const { Sequelize, DataTypes } = require('sequelize');
// To use the URI syntax, we need an explcit username and password.
// But the second constructor works with peer authentication.
// https://stackoverflow.com/questions/46207155/sequelize-and-peer-authentication-for-postgres
//
// Fails
//const sequelize = new Sequelize('postgres://user:password@localhost:5432/lkmc-nodejs')
const sequelize = new Sequelize('lkmc-nodejs', undefined, undefined, {
host: '/var/run/postgresql',
dialect: 'postgres',
logging: false,
//
// Works with peer authentication:
//const sequelize = new Sequelize('lkmc-nodejs', undefined, undefined, {
// host: '/var/run/postgresql',
// dialect: 'postgres',
// logging: false,
//});
const sequelize = new Sequelize({
dialect: 'sqlite',
storage: 'tmp.sequelize.sqlite',
});
// OMG fuck this asynchronous bullshit: