From 06c7244ce74808a7bc1ad6940dcd877efa10527f Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 14 Aug 2018 20:10:41 -0700 Subject: start cockroachdb branch --- rust/README.cockroach.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 rust/README.cockroach.md 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 -- cgit v1.2.3