Macro diesel::no_arg_sql_function[][src]

macro_rules! no_arg_sql_function {
    ($type_name : ident, $return_type : ty) => { ... };
    ($type_name : ident, $return_type : ty, $docs : expr) => { ... };
    ($type_name : ident, $return_type : ty, $docs : expr, $($constraint : ident)
 :: +) => { ... };
}
👎 Deprecated since 2.0.0:

Use sql_function! instead. See CHANGELOG.md for migration instructions

Expand description

Declare a 0 argument SQL function for use in your code. This will generate a unit struct, which is an expression representing calling this function. See now for example output. now was generated using:

no_arg_sql_function!(now, sql_types::Timestamp, "Represents the SQL NOW() function");

You can optionally pass the name of a trait, as a constraint for backends which support the function.