The Toql Derive creates all the boilerplate functions to make the ✨ happen. Using the derive is the easiest way to deal with your structs and is therefore recommended. However beware that the generated code size can become large as it's about ~9K lines of code for a small struct. You may disable some functionality.
For a derived struct the following is generated:
- Trait Mapped to map struct to SqlMapper.
- Methods for all fields to support building a Query.
- Methods to load, insert, delete and update a struct. Requires database feature.
Example:
use Toql;
Check out the guide for list of available attributes.