aboutsummaryrefslogtreecommitdiffstats
path: root/rust/README.md
blob: 794afee7dd54f18defd7e5016f3f689a3d71507b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

Things!

    sudo apt install libsqlite3-dev libpq-dev

    wget https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-codegen-cli/3.0.0-SNAPSHOT/swagger-codegen-cli-3.0.0-20180411.134218-60.jar

    cargo swagger ../golang/fatcat-openapi2.yml gen-out

    diesel print-schema > src/database_schema.rs

Regenerate API schemas:

    cargo swagger fatcat-openapi2.yml fatcat-api --docker-tag=v2.3.1
    sudo chown `whoami`:`whoami` -R fatcat-api
    # edit fatcat-api/Cargo.toml, set name to "fatcat-api"
    cargo fmt

Debugging SQL errors:

    psql fatcat_rs < migrations/2018-05-12-001226_init/up.sql

Creating entities:

    http --json post localhost:9411/v0/container name=asdf issn=1234-5678