GithubHelp home page GithubHelp logo

slumber86 / express-oracle-session Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chill117/express-mysql-session

1.0 1.0 10.0 277 KB

An Oracle session store for express

License: MIT License

JavaScript 100.00%
hacktoberfest

express-oracle-session's People

Contributors

albertosouza avatar cgalibern avatar chill117 avatar erkez avatar jayprakash1 avatar lopatkinevgeniy avatar ravenscar avatar slumber86 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

express-oracle-session's Issues

Fails to build on Node 12 because of old oracledb 1.12.2 dependency

Currently express-oracle-session depends on "oracledb": "^1.12.2", which is a pretty old package, while oracledb version 4 is out there.
And that seems to be a problem for Node 12, where oracledb with version lower than 4 fails to build.
Are there plans to review and bump dependencies?
Thank you.

support passing of PoolAlias to oracledb.getconnection

You pass the passed 'options' to oracledb.createPool which means that we can set createPool related options. Once such option supported by oracledb is poolAlias. You go on to oracledb.getConnection and by not passing a poolAlias, you hardcode to use the 'default' pool. Your solution would be more robust if you instead oracledb.getconnection(options.poolAlias || 'default'......

cheers!

Enforce ARRAY outFormat

Great module. One small tweak: could you enforce outFormat: oracledb.ARRAY for all the execute calls that rely on arrays as return value? I am running the store in a context where the global outFormat of the oracledb module gets overwritten, and thus the parsing of the session string fails.
E.g., in row 144 of index.js:
this.connection.execute(sql, params, { fetchInfo: { "DATA": { type: oracledb.STRING} } },
instead, use
this.connection.execute(sql, params, { outFormat: oracledb.ARRAY, fetchInfo: { "DATA": { type: oracledb.STRING} } },
Thanks,
Florian

Unit test are failing for db Connection issues

When execuded one to one almost all unit test are passing, when build in CI or with npm test timeouts happens for oracle connection, if there is someone with better understatment of oracle driver, help will be appreciated

Error: Failed to parse data for session: U8vEpeRt0jI-Ytic3nCmmvEagF7rxmEJ

For the first time, when there is no session, it is working correctly. However, I am Getting following error during second request for the same REST API

Error: Failed to parse data for session: U8vEpeRt0jI-Ytic3nCmmvEagF7rxmEJ
at C:\project\proj1\node_modules\express-oracle-session\lib\index.js:160:15
at custExecuteCb (C:\project\proj1\node_modules\oracledb\lib\connection.js:117:5)

Code is mentioned below

`var session = require('express-session');
var oracleDbStore = require('express-oracle-session')(session);
var sessionStoreOptions = {
checkExpirationInterval: 900000,// How frequently expired sessions will be cleared; milliseconds. Here 15 minutes.
expiration: 1800000,// The maximum age of a valid session; milliseconds. Here 30 minutes.
createDatabaseTable: true,// Whether or not to create the sessions database table, if one does not already exist.
connectionLimit: 1
};
var sessionStore = new oracleDbStore(sessionStoreOptions, connection);

app.use(session({
    key: 'sessionID',
    secret: 'secret',
    store: sessionStore,
    resave: false,
    saveUninitialized: true
}));`

I tried to debug and found that in the index.js (inside lib) at line number 155, 'JSON.parse(result.rows[0][0])' is done. Instead it should be 'JSON.parse(result.rows[0].data)'.

Code from index.js (present in lib) is as follows
`try {
//debug_log('Session result: ' + result.rows[0]);
var session = result.rows[0] !== undefined ? JSON.parse(result.rows[0][0]) : null;
//debug_log('Session return: ' + session);

		} catch (error) {
			debug_error(error);
			return cb(new Error('Failed to parse data for session: ' + session_id));
		}`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.