0.1.4 • Published 3 years ago

express-session-mariadb-store v0.1.4

Weekly downloads
16
License
MIT
Repository
gitlab
Last release
3 years ago

A express session store with the mariadb connector

Install

npm install express-session-mariadb-store
yarn add express-session-mariadb-store

make sure you have a database with a table create like the following example:

CREATE TABLE session(
  sid                     VARCHAR(100) PRIMARY KEY NOT NULL,   
  session                 VARCHAR(2048) DEFAULT '{}',   
  lastSeen                DATETIME DEFAULT NOW() 
);

Use

commonJS (New connection pool)

const session = require('express-session')
const MariaDBStore = require('express-session-mariadb-store')

app.use(session({
  store: new MariaDBStore({
    user: 'user',
    password: 'password'
  })
}))

commonJS (Reuse connection pool)

const session = require('express-session')
const MariaDBStore = require('express-session-mariadb-store')

app.use(session({
  store: new MariaDBStore({
    pool: existingConnectionPool
  })
}))

Config

All config options for the MariaDBStore:

keydefault
sessionTable'session'
host'localhost'
userundefined
passwordundefined
database'sessiondb'
connectionLimit5
poolundefined
0.1.4

3 years ago

0.1.2

3 years ago

0.1.3

3 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.1

4 years ago