# connect-monetdb

> A straightforward MonetDB session store for Connect/Express

Latest version **1.0.9** (published 2016-03-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install connect-monetdb
pnpm add connect-monetdb
yarn add connect-monetdb
bun add connect-monetdb
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.9 |
| Published | 2016-03-11 |
| First published | 2014-10-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | R. Cijvat |
| Maintainers | rcijvat |
| Keywords | MonetDB, Express, Connect |

## Links

- npm: https://www.npmjs.com/package/connect-monetdb
- Repository: https://github.com/MonetDB/npm-connect-monetdb
- Homepage: https://github.com/MonetDB/npm-connect-monetdb#readme
- Issues: https://github.com/MonetDB/npm-connect-monetdb/issues
- npm.io page: https://npm.io/package/connect-monetdb

## Recent versions

- 1.0.9 (latest) — 2016-03-11
- 1.0.8 — 2016-03-11
- 1.0.7 — 2016-03-10
- 1.0.6 — 2016-03-10
- 1.0.5 — 2016-03-10
- 1.0.4 — 2016-03-09
- 1.0.3 — 2016-03-09
- 1.0.2 — 2015-11-04
- 1.0.1 — 2015-11-03
- 1.0.0 — 2015-11-03
- 0.0.8 — 2014-10-31
- 0.0.7 — 2014-10-31
- 0.0.5 — 2014-10-29
- 0.0.4 — 2014-10-29
- 0.0.3 — 2014-10-29
- … 2 more at https://npm.io/package/connect-monetdb/versions

## README

# connect-monetdb

[![Build Status](https://travis-ci.org/MonetDB/npm-connect-monetdb.svg)](https://travis-ci.org/MonetDB/npm-connect-monetdb)
[![npm version](https://badge.fury.io/js/connect-monetdb.svg)](http://badge.fury.io/js/connect-monetdb)

A straightforward MonetDB session store for Connect/Express. This module has no direct dependencies, but it does require you to pass it two things:

1. A session variable, resulting from require("express-session")
2. A [MonetDBConnection](https://github.com/MonetDB/monetdb-nodejs#mdbconnection), 
or a [MonetDBPool](https://github.com/MonetDB/monetdb-pool-nodejs) object

# Installation
npm install [-g] connect-monetdb

# Create a table to store session information

```sql
CREATE TABLE session (
    sid              STRING        NOT NULL PRIMARY KEY,
    sess             STRING        NOT NULL,
    expire           INT           NOT NULL
);
```

# Usage
**Initializing the store by creating a MonetDBConnection object and passing it to the store constructor**
```javascript
var MonetDBConnection = require('monetdb')();
var session = require("express-session");
var MDBSessStore = require("connect-monetdb")(session);

var conn = new MonetDB({ dbname: "demo" });
conn.connect();

var store = new MDBSessStore(conn);
```

**Initializing the store by creating a MonetDBPool object and passing it to the store constructor**
```javascript
var MonetDBPool = require('monetdb-pool')();
var session = require("express-session");
var MDBSessStore = require("connect-monetdb")(session);

var pool = new MonetDBPool({ nrConnections: 4 }, { dbname: "demo" });
pool.connect();

var store = new MDBSessStore(pool);
```

**Set up the express app to use the just created store**
```javascript
var sessOpt = {
	store: store,
	secret: "i2D#0wj38D_kZhW20&qA97hQQd@0/S81h",
	rolling: true,
	resave: false,
	saveUninitialized: true,
	unset: "destroy"
};

var app = require("express")();
app.use(session(sessOpt));
```

**Please report any suggestions/bugs to robin.cijvat@monetdbsolutions.com**

---
_Source: https://npm.io/package/connect-monetdb · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
