sqlx/examples/sqlite/todos
Austin Bonander dcb58b0e2c
0.7.0 release (#2575)
* WIP preparing 0.7.0 release

* fix: re-enable examples

* fix doctests in `sqlx-core`

* cherry-pick CHANGELOG entry for 0.6.3

* add actions workflow for examples

* fix(cli): close connection after running migrations

* fix examples

* fix(sqlite): fix parsing of URLs via `Any`

* fix(example): don't let Postgres `listen` example run forever

* fix Postgres `transaction` example
2023-07-03 14:37:37 -07:00
..
migrations update todo examples to 0.4 and use migrations 2020-07-18 05:43:16 -07:00
src 0.7.0 release (#2575) 2023-07-03 14:37:37 -07:00
Cargo.toml 0.7.0 release (#2575) 2023-07-03 14:37:37 -07:00
README.md update todo examples to 0.4 and use migrations 2020-07-18 05:43:16 -07:00

TODOs Example

Setup

  1. Declare the database URL

    export DATABASE_URL="sqlite:todos.db"
    
  2. Create the database.

    $ sqlx db create
    
  3. Run sql migrations

    $ sqlx migrate run
    

Usage

Add a todo

cargo run -- add "todo description"

Complete a todo.

cargo run -- done <todo id>

List all todos

cargo run