mirror of https://github.com/rwf2/Rocket.git
Clarify todo example requirements.
This commit is contained in:
parent
588d95aa58
commit
3d0f7f2f80
|
@ -11,7 +11,7 @@ lazy_static = "*"
|
||||||
serde = "0.8"
|
serde = "0.8"
|
||||||
serde_json = "0.8"
|
serde_json = "0.8"
|
||||||
serde_derive = "0.8"
|
serde_derive = "0.8"
|
||||||
diesel = "0.9"
|
diesel = { version = "0.9", features = ["sqlite"] }
|
||||||
diesel_codegen = { version = "0.9", features = ["sqlite"] }
|
diesel_codegen = { version = "0.9", features = ["sqlite"] }
|
||||||
|
|
||||||
[dependencies.rocket_contrib]
|
[dependencies.rocket_contrib]
|
||||||
|
|
|
@ -1,16 +1,23 @@
|
||||||
Rocket Todo Example
|
# Rocket Todo Example
|
||||||
===================
|
|
||||||
|
|
||||||
Before running this example, you'll need to ensure there's a database file
|
This example makes use of a SQLite database via `diesel` to store todo tasks. As
|
||||||
present. You can do this with Diesel.
|
a result, you'll need to have `sqlite3` and its headers installed:
|
||||||
|
|
||||||
Running migration with Diesel
|
* **OS X:** `brew install sqlite`
|
||||||
-----------------------------
|
* **Debian/Ubuntu:** `apt-get install libsqlite3-dev`
|
||||||
|
* **Arch:** `pacman -S sqlite`
|
||||||
|
|
||||||
Just run the following commands in your shell:
|
**Before running this example, you'll also need to ensure there's a database
|
||||||
|
file with the correct tables present.** On a Unix machine or with bash
|
||||||
|
installed, you can simply run the `boostrap.sh` script. The script installs the
|
||||||
|
`diesel_cli` tools if they're not already installed and runs the migrations.
|
||||||
|
|
||||||
|
## Manually Running Migrations
|
||||||
|
|
||||||
|
You can also run the migrations manually with the following commands:
|
||||||
|
|
||||||
```
|
```
|
||||||
cargo install diesel_cli # installs the diesel CLI tools
|
cargo install diesel_cli # install diesel CLI tools
|
||||||
DATABASE_URL=db/db.sql diesel migration run # create db/db.sql
|
DATABASE_URL=db/db.sql diesel migration run # create db/db.sql
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue