Gathering detailed insights and metrics for connect-session-knex
Gathering detailed insights and metrics for connect-session-knex
Gathering detailed insights and metrics for connect-session-knex
Gathering detailed insights and metrics for connect-session-knex
npm install connect-session-knex
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
92 Stars
290 Commits
67 Forks
3 Watching
1 Branches
40 Contributors
Updated on 25 Oct 2024
TypeScript (71.3%)
JavaScript (28.7%)
Cumulative downloads
Total Downloads
Last day
-0.8%
13,455
Compared to previous day
Last week
-3.4%
71,339
Compared to previous week
Last month
-3.6%
311,526
Compared to previous month
Last year
85.3%
3,710,653
Compared to previous year
connect-session-knex is an express-session store backed by PostgreSQL, MySQL, MariaDB, MSSQL, Oracle or SQLite3, via the knex.js library.
1$ npm install connect-session-knex
See Changelog.md
Example application using the defaults
Example application with PostgreSQL
cleanupInterval
milliseconds between clearing expired sessions. Defaults to 60000. 0 disables the automatic clearing of expired sessions.createTable
if the table for sessions should be created automatically or not.knex
knex instance to use. Defaults to a new knex instance, using sqlite3 with a file named 'connect-session-knex.sqlite'tableName='sessions'
Tablename to use. Defaults to 'sessions'.sidFieldName='sid'
Field name in table to use for storing session ids. Defaults to 'sid'.If the table does not exist in the schema, this module will attempt to create it unless the createTable
option is false.
If a knex instance is not provided, this module will attempt to create a sqlite3 database, with a file named connect-session-knex.sqlite
, in the working directory of the process.
Column | Type | Modifiers | Storage |
---|---|---|---|
sid | character varying(255) | not null | extended |
sess | json | not null | extended |
expired | timestamp with time zone | not null | plain |
"sessions_pkey" PRIMARY KEY, btree (sid)
"sessions_expired_index" btree (expired)
Table Name sessions
.
Column | Type | Modifiers |
---|---|---|
sid | VARCHAR(255) | NOT NULL, PK |
sess | JSON | NOT NULL |
expired | DATETIME | NOT NULL |
Command to manually create table:
1CREATE TABLE `sessions` ( 2 `sid` VARCHAR(255) NOT NULL, 3 `sess` JSON NOT NULL, 4 `expired` DATETIME NOT NULL, 5 PRIMARY KEY (`sid`));
Install Postgresql
Instructions for Ubuntu after intalling the db:
1sudo -u postgres psql
1CREATE DATABASE travis_ci_test OWNER postgres;
1GRANT all privileges ON DATABASE travis_ci_test TO postgres;
1ALTER USER postgres WITH PASSWORD 'postgres';
1\q
Install Mysql
Instructions for Ubuntu after installing the db:
1sudo mysql -u root
1create user 'travis' identified by 'travis';
1ALTER USER 'travis'@'localhost' IDENTIFIED BY 'travis';
1create database travis_ci_test;
1grant all on travis_ci_test.* to 'travis';
1\q
1sudo service mysql restart
Make sure both the MySQL and Postgres services are running
1npm run test
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
8 existing vulnerabilities detected
Details
Reason
Found 1/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More