mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-25 19:21:35 +01:00
sequelize sqlite
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user