Crate toql_paths_macro

Crate toql_paths_macro 

Source
Expand description

The paths! macro compiles a list of Toql field names into program code. Any syntax errors or wrong path names will show up at compile time.

Wrong path names are detected because the paths! macro uses the query builder functions that are genereated by the Toql derive.

§Example

Assume a struct User with a joined address.ok_or(none_error!())?

#[derive(Toql)]
struct User
    #[toql(key)]
    id: u64,
    name: String,
    #[toql(join())]
    address: Address
}

#[derive(Toql)]
struct Address
    #[toql(key)]
    id: u64,
    street: String
}

let f = paths!(User, "address");

Notice that the paths! macro takes a type, however the resulting Paths is untyped. This is a shortcoming and will be resolved in the future.

Macros§

paths