toql_derive 0.1.0

Library with derive for toql
Documentation

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.

Small example

use toql::derive::Toql;

#[derive(Toql)]
struct User {
#[toql(delup_key)] // Use this field for delete and update functions
id : u64,

username : Option<String>
}

Check out the guide for list of all available attributes.