Macro light_magic::db

source ·
db!() { /* proc-macro */ }
Expand description

Creates the Database struct with the fitting logic

§Functions

  • insert_#table
  • get_#table
  • delete_#table
  • search_#table

§Example

db! {
    // `users` is the table name
    user => { id: usize, name: String, kind: String },
    // `{...}` is the table data
    permission => { user_name: String, level: Level },
    // the first field, like here `user_name`, is the `primary_key`
    criminal => { user_name: String, entry: String }
}