If you have a 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 simply use pip:
pip install rethinkdb
This may not be the best way to do this, but it may be the easiest way to achieve this if you want to create the database on a single line from the command line.
If you are a Node.js developer, I would recommend using the two specified mglukhovsky CLIs.
source
share