node-orm2 icon indicating copy to clipboard operation
node-orm2 copied to clipboard

add possibility to manage manually a connection with pool feature

Open Drazke opened this issue 9 years ago • 4 comments

Issue #284

New function :

db.driver.createPool(cb) --> return connectionId;
db.driver.releasePool(connectionId);

Updated function :

Model.create(data, connectionId, cb)
Instance.useConnection(connectionId).chainFunction()

Drazke avatar Sep 04 '16 02:09 Drazke

Looks pretty good, thanks. @dresende what do you think?

dxg avatar Sep 05 '16 23:09 dxg

If it doesn't break anything, it's all good to me 👍

dresende avatar Sep 10 '16 16:09 dresende

SELECT ... FOR UPDATE

Model.find().where("id = 1 FOR UPDATE").run(function(err, result){ ... });

in transaction i want to lock by select is method useConnectionId can't use in model ? @Drazke @dxg @dresende

qq85911308 avatar Feb 16 '17 04:02 qq85911308

@Drazke @dresende Any update on this one, should it reach npm or should I check it out locally? Same question for https://github.com/dresende/node-orm-transaction/pull/6

Ottunger avatar Jul 05 '18 05:07 Ottunger