Crate symbols

source ·
Expand description

Symbols

This is an utility to build a proc-macro that connects to a database, retrieves data from given table and populates an enum variants with primary keys values
It also generates a method for every non-primary-key field, and, when there are multiple primary keys, a costructor for every possible subset of primary keys

Traits

  • This trait allows data filtering on macro execution
    It’s default implementation simply adds WHERE 1 = 1 to data retrieve query

Functions

  • Main function
    Given a database model (via generics), an enum item, a list of arguments and an async function to retrieve a database connection it populates the enum using primary key(s) values.
    Only string-typed primary keys are supported.