rawberg / connect-sqlite3

SQLite3 session store for connect and express.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dbCleanup not working

literallylara opened this issue · comments

Perhaps it's just me, but the comparison in line 39 does not seem to be working, since expired was declared as a TEXT field. If I cast it as INTEGER it works as intended, e.g.:

function dbCleanup(store) {
    var now = new Date().getTime();
    store.db.run('DELETE FROM ' + store.table + ' WHERE ? > CAST(expired as INTEGER)', [now]);
}

It would probably be more performant to just declare expired as INTEGER when the db is created though?