ronzeidman / rebirthdbts

Rebirth DB experimental TypeScript driver

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unable to connect. promise hangs forever

oferitz opened this issue · comments

OS: OSX
Node: 8.11.2
Platform: Electron

const { r }  = require('rebirthdbts')

let connection

const driver = {
  connect: async function(config = {}) {
    const options = { pool: false, ...config }
    console.info('new connection request')
    connection = await r.connect(options)
    console.info('connected')
    return connection
  }
}

module.exports = driver

When calling

driver.connect({host: 'localhost', port: 28015})

the promise from r.connect never returns. in the log you only see new connection request

Fixed!
Also now you can use {host: '..', port: ...} in connection and it will work.
Also TLS is now also supported, you can just use:
r.connect({ pool: false, server: { tls: true, host: 'server', port: 28015, ca: ..., < any other options you would put on a tls connect function > } })