You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'use strict';
import pg from 'pg';
import knex from 'knex';
import { ConnectSessionKnexStore } from 'connect-session-knex';
import consts from './consts.cjs';
const db = knex({
client: 'pg',
connection: {
host: consts.DB_HOST,
port: consts.DB_PORT,
user: consts.DB_USER,
password: consts.DB_PASS,
database: consts.DB_DB
},
searchPath: consts.DB_SCHEMA
});
const sessionStore = new ConnectSessionKnexStore({
db,
tablename: 'sessions'
});
It appears that this is because ConnectSessionKnexStore needs the knex instance to be in a key named knex, not simply on it's own as above in the sessionStore var, and changing db, to knex: db, does appear to solve the issue. Is this just a mistake in the example that needs corrected?
The text was updated successfully, but these errors were encountered:
This code is adapted from the example at https://github.com/gx0r/connect-session-knex/blob/main/examples/example-postgres.mjs but results inthe error
Cannot find module 'sqlite3'
innode_modules/connect-session-knex/dist/index.js:26:36
It appears that this is because
ConnectSessionKnexStore
needs the knex instance to be in a key namedknex
, not simply on it's own as above in thesessionStore
var, and changingdb,
toknex: db,
does appear to solve the issue. Is this just a mistake in the example that needs corrected?The text was updated successfully, but these errors were encountered: