Open SlyDave opened 7 years ago
Thanks. That's not as ugly as the quick fix I used: editing the vendor file (\duxet\Rethinkdb\Connection):
- $this->connection = r\connect($config['host'], $port, $this->database, $authKey);
+ $this->connection = r\connect($config, $port, $this->database, $authKey);
The package doesn't support connecting to Rethink that uses a username and password.
r/connect has really odd usage (and lets not talk about the global namespace functions...)
Simple connection:
r\connect($host, $port, $database, $apiKey);
With username/password:
duxet's constructor doesn't support this: (it also confuses authkey for apikey)
For now I've done the following:
Updated the 'connections' entry in config/database.php and added in username and password:
e.g.:
Then I've created a ugly new class app\RethinkDb\Connection, extending \duxet\Rethinkdb\Connection overloading __construct and handling the extra config data (note the lack of any real validation :P):
e.g.:
This then required a new ServiceProvider to replace the resolving of db:rethinkdb with the custom Connection rather than the package provided one (note the use statement which replaces which Connection is being used rather than the one in the Rethinkdb namespace, we use our custom one, other than that, there are no changes)
App\Providers\RethinkdbServiceProvider::class,
It'd be great if the package would support the full range of connectivity offered by rethink...