From f997c5bcbcc800a8780a62dc56a4b7f4e5b68c3c Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 24 Aug 2018 13:29:29 -0700 Subject: split/move docs around --- rust/HACKING.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 rust/HACKING.md (limited to 'rust/HACKING.md') diff --git a/rust/HACKING.md b/rust/HACKING.md new file mode 100644 index 00000000..a399164c --- /dev/null +++ b/rust/HACKING.md @@ -0,0 +1,24 @@ + +## Updating Schemas + +Regenerate API schemas after editing the fatcat-openapi2 schema. This will, as +a side-effect, also run `cargo fmt` on the whole project, so don't run it with +your editor open! + + cargo install cargo-swagger # uses docker + ./codegen_openapi2.sh + +Update Rust database schema (after changing raw SQL schema): + + diesel database reset + diesel print-schema > src/database_schema.rs + +Debug SQL schema errors (if diesel commands fail): + + psql fatcat_test < migrations/2018-05-12-001226_init/up.sql + +## Direct API Interaction + +Creating entities via API: + + http --json post localhost:9411/v0/container name=asdf issn=1234-5678 -- cgit v1.2.3