I've got knex configured to use MySQL with pooling:
var knex = require("knex")({
client: "mysql",
connection: {
host: ...,
user: ...,
password: ...,
database: ...
},
pool: {
min: 0,
max: 20
}
});
I'm also using express-session and I'm planning on a switch to express-mysql-session for the store.
So, I want to use the connection pool that knex creates, so I can use the same pool for all DB access.
Is there any way to get a connection pool from knex that I can pass to the MySQL session store constructor? Or some other way to use the same pool for everything?
It's not possible, I filed a feature request at https://github.com/tgriesser/knex/issues/1824 .
A suggestion given there for my particular use case was to perhaps create an express-knex-session module, which I am going to do as soon as I can. I will update this with a link when I do.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.