diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-08-14 20:10:41 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-08-14 20:10:41 -0700 |
commit | 06c7244ce74808a7bc1ad6940dcd877efa10527f (patch) | |
tree | ca3b1b574b6c1d058616edc1855bc3945adc10dc | |
parent | 39921a6fdf47256b9c2fac67b876795fd0426464 (diff) | |
download | fatcat-06c7244ce74808a7bc1ad6940dcd877efa10527f.tar.gz fatcat-06c7244ce74808a7bc1ad6940dcd877efa10527f.zip |
start cockroachdb branch
-rw-r--r-- | rust/README.cockroach.md | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/rust/README.cockroach.md b/rust/README.cockroach.md new file mode 100644 index 00000000..e42d8c4b --- /dev/null +++ b/rust/README.cockroach.md @@ -0,0 +1,24 @@ + +Setup a user and database on a local, single-host node: + + # using v2.0.5 (2018/08/13) + cockroach start --insecure --store=fatcat-dev --host=localhost + cockroach user set maxroach --insecure + cockroach sql --insecure -e 'CREATE DATABASE fatcat' + cockroach sql --insecure -e 'GRANT ALL ON DATABASE fatcat TO maxroach' + cockroach sql --insecure -e 'CREATE DATABASE fatcat_test' + cockroach sql --insecure -e 'GRANT ALL ON DATABASE fatcat_test TO maxroach' + +Create a .env file: + + DATABASE_URL=postgres://maxroach@localhost:26257/fatcat + TEST_DATABASE_URL=postgres://maxroach@localhost:26257/fatcat_test + RUST_TEST_THREADS=1 + +Create: + + cockroach sql --insecure -d fatcat < migrations/2018-05-12-001226_init/down.sql + cockroach sql --insecure -d fatcat < migrations/2018-05-12-001226_init/up.sql + + cockroach sql --insecure -d fatcat_test < migrations/2018-05-12-001226_init/down.sql + cockroach sql --insecure -d fatcat_test < migrations/2018-05-12-001226_init/up.sql |