neumino / rethinkdbdash

An advanced Node.js driver for RethinkDB with a connection pool, support for streams etc.
MIT License
848 stars 109 forks source link

Disabling pooling in rethinkdbdash #314

Closed anupdg closed 7 years ago

anupdg commented 7 years ago

Hi There,

I was trying to disable pooling. But it breaks saying "run was called without a connection and no pool has been created". Code is very simple-

var r = require('rethinkdbdash')({
    pool: false,
    cursor: true,
    host: 'xx.xx.xx.xx,
    port: 28015,
    db:'brief-prod'
});

r.table('users').run().then(function(cursor) {
  cursor.toArray().then(function(result) {
    console.log(result);
  });
});

Not sure what am I missing. Stack is as follows-

D:\POCs\NodePOCs\rethinkdbdash\node_modules\rethinkdbdash\lib\term.js:124 throw new Error.ReqlDriverError('run was called without a connection and no pool has been created', self._query); ^ ReqlDriverError: run was called without a connection and no pool has been created after: r.table("users") at Term.run (D:\POCs\NodePOCs\rethinkdbdash\node_modules\rethinkdbdash\lib\term.js:124:13) at Object. (D:\POCs\NodePOCs\rethinkdbdash\server.js:9:18) at Module._compile (module.js:541:32) at Object.Module._extensions..js (module.js:550:10) at Module.load (module.js:458:32) at tryModuleLoad (module.js:417:12) at Function.Module._load (module.js:409:3) at Timeout.Module.runMain [as _onTimeout] (module.js:575:10) at tryOnTimeout (timers.js:228:11) at Timer.listOnTimeout (timers.js:202:5)

Thanks Anup

neumino commented 7 years ago

If you don't use a pool, you have to manually create connections with r.connect

anupdg commented 7 years ago

Can you please direct me any sample for this. I could not find any example for the same.

neumino commented 7 years ago

https://github.com/neumino/rethinkdbdash/blob/master/test/accessing-reql.js

On Mon, Nov 21, 2016, 00:10 asteranup notifications@github.com wrote:

Can you please direct me any sample for this. I could not find any example for the same.

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/neumino/rethinkdbdash/issues/314#issuecomment-261870262, or mute the thread https://github.com/notifications/unsubscribe-auth/ABZOu7x1z3lYvFmZcDxp3DVduv1NCXTBks5rAVH9gaJpZM4K3xxU .