I need to programatically create a RethinkDB database from the command line. However...I have no clue how to do this.
I know that I can do this from the web UI or from a client driver, but isn't there a command that does this?
As mlucy mentioned, you can create databases and tables using the query language. If you'd like to run RethinkDB queries directly from the command line, you may want to try one of these libraries:
If you have the Python driver you can do the following:
echo -e 'import rethinkdb as r; \nr.connect("localhost", 28015).repl() \nr.db_create("NAME_OF_YOUR_DATABASE").run()' | python
To install the Python driver, you can just use pip:
pip install rethinkdb
This might not be the best way of doing this, but it might be the easiest way of achieving this if you want to create a database in one line from the command line.
If you a Node.js developer, I would recommend using the two CLIS mglukhovsky mentioned.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With