Austin Bonander a2eceec33b
chore: replace dotenv with dotenvy (#2003)
* chore: replace `dotenv` with `dotenvy`

The former appears to be unmaintained and the latter is a drop-in replacement.

* chore: fix all warnings
2022-07-28 14:33:44 -07:00
..
2020-11-12 07:21:54 -08:00

JSON Example

Setup

  1. Declare the database URL

    export DATABASE_URL="postgres://postgres:password@localhost/json"
    
  2. Create the database.

    $ sqlx db create
    
  3. Run sql migrations

    $ sqlx migrate run
    

Usage

Add a person

echo '{ "name": "John Doe", "age": 30 }' | cargo run -- add

or with extra keys

echo '{ "name": "Jane Doe", "age": 25, "array": ["string", true, 0] }' | cargo run -- add

List all people

cargo run