marceloneppel / rethinkdb

Dart 2 and Flutter driver for RethinkDB.
https://pub.dartlang.org/packages/rethinkdb_dart
MIT License
25 stars 10 forks source link

Remote rethinkdb connection #18

Open ziasultan2 opened 4 years ago

ziasultan2 commented 4 years ago

Hi dear. Can I connect remote database with this package along with my database login credentials

marceloneppel commented 4 years ago

Hi @ziasultan2! You can try something like:

var sslmap = {
  'ca': './path/certificate.pem',
};
// Create the database connection.
connection = await r.connect(
    db: 'test',
    host: 'your-database-host.com',
    port: 29015,
    user: 'admin',
    password: 'password',
    ssl: sslmap);
Cyrus-0101 commented 3 years ago

Hello @marceloneppel, After writing this piece of code,

var sslmap = { 'ca': '../../credentials/cert.pem', }; connection = await r.connect( db: 'test', host: 'my-database-host.com', port: 28015, user: 'abc', password: 'abc' ssl: sslmap, );

I seem to get this error,

FileSystemException: Cannot open file, path = '../../credentials/isrgrootx1.pem' (OS Error: No such file or directory, errno = 2)

Am I not doing it right. That is exactly where the file lives after bringing it from import it works but can't read it after importing directly from imports.