
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
ti-rethinkdb-pool
Advanced tools
A Node.JS Connection Pool for RethinkDB that returns promises.
RethinkDB is Actively working on their own connection pool for all the official drivers, which is super great and once that is out you should definitely use that instead of this.
But maybe you're interested in today, not tomorrow. Me too.
Using it is easy:
var r = require('ti-rethinkdb-pool')();
r.pool.run(..your rethinkdb query here..).then(function(res) {
// do something with the result.
});
It returns a promise which you can consume however you like.
It works great with harmony node's generators & co:
var r = require('ti-rethinkdb-pool');
var co = require('co');
co(function *() {
var res = yield r.pool.run(r.table('foo'));
// do something with the result.
});
r
object, not an r
and a pool
.It automatically .toArray()
's cursors, so you should never have to deal with cursors directly, nor have to worry about releasing the pool connection after you are done with the cursor. There is currently no provision if you want to deal with cursors directly, but it looks like the official RethinkDB connection pool will.
This monkeypatches the r
namespace, which is definitely a no-no, but is also the cleanest way I could come up with to only pass around one object (r
) when making queries.
var r = require('lib/rethinkdb_pool')({
host: 'localhost',
port: '28015',
db: 'test',
authKey: null,
min: 2,
max: 10
});
FAQs
A connection pool for RethinkDB.
We found that ti-rethinkdb-pool demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.