rs-basic/members/diesel-demo
Christoph J. Scherr c2ec251cdb
cargo devel CI / cargo CI (push) Successful in 3m16s Details
Merge branch 'master' of https://git.cscherr.de/PlexSheep/rs-basic
2024-06-27 13:53:38 +02:00
..
migrations yay we can create posts 2024-06-27 11:51:28 +02:00
src Merge branch 'master' of https://git.cscherr.de/PlexSheep/rs-basic 2024-06-27 13:53:38 +02:00
.env a lot of early diesel stuff 2024-06-26 16:12:49 +02:00
Cargo.toml read, colors and unpublish 2024-06-27 13:39:54 +02:00
README.md a lot of early diesel stuff 2024-06-26 16:12:49 +02:00
diesel.toml a lot of early diesel stuff 2024-06-26 16:12:49 +02:00

README.md

Diesel seems more complex

This project uses sqlite as I can't be bothered to host a postgres instance just for this.

Setup

  • Install diesel and the diesel CLI tool.
  • DATABASE_URL=./data/dieseldemo.db diesel setup
  • We create migrations up/down and fill them with sql to do something and undo something
  • Alternatively, we can use a rust macro to define schemes that become sql through magic. I like this way better for this project because I learn more diesel and also because it avoids having to deal with incompatibilities of the database types (maybe).
    • Run diesel migration generate --diff-schema create_posts

Ressources