January 2019
Intermediate to advanced
520 pages
14h 32m
English
Our tool will have two modules with a data structure. The first is the src/schema.rs module, which contains a table! macro call that declares the fields of every table. In our case, this module contains the following declaration:
table! { users (id) { id -> Text, name -> Text, email -> Text, }}
This file was automatically generated by the diesel setup command. When you run a setup, it creates a diesel.toml configuration file with the following contents:
# For documentation on how to configure this file,# see diesel.rs/guides/configuring-diesel-cli[print_schema]file = "src/schema.rs"
As you can see, the config has a schema module reference. A schema.rs file is also generated, and will be updated on every compilation. ...
Read now
Unlock full access