express-session-sqlite
A session store for express-session
using SQLite.
Fully unit tested. PRs welcomed.
Install
$ npm i express-session-sqlite sqlite3 --save
Usage
import * as sqlite3 from 'sqlite3'
import * as express from 'express'
import sqliteStoreFactory from 'express-session-sqlite'
import session from 'express-session'
const SqliteStore = sqliteStoreFactory(session)
const app = express()
app.use(session({
store: new SqliteStore({
driver: sqlite3.Database,
path: '/tmp/sqlite.db',
ttl: 1234,
prefix: 'sess:',
cleanupInterval: 300000
}),
}))
Debugging
This module uses debug
under the name express-session-sqlite
. When starting up your app, do the following:
$ DEBUG=express-session-sqlite node app.js
2.0.4 - Tue Apr 07 2020 04:35:00
Contributor: [Theo Gravity](https://github.com/Theo Gravity)
- Update packages to latest
Update set
to do an upsert instead of insert.