sql-table-macros

Crates.iosql-table-macros
lib.rssql-table-macros
version
sourcesrc
created_at2024-11-16 21:43:06.859204
updated_at2024-11-16 22:09:14.94391
descriptionHelper macros to generate SQL table definitions
homepage
repositoryhttps://github.com/qyuzh/sql-table-macros
max_upload_size
id1450694
Cargo.toml error:TOML parse error at line 19, column 1 | 19 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
qyuzh (qyuzh)

documentation

https://docs.rs/sql-table-macros

README

sql-table-macros

Helper macros to auto add sql table common fields to struct definition

Example

#![allow(dead_code)]
use sql_table_macros::table_common_fields;

type Id = u64;

#[table_common_fields(Id, std::time::Duration)]
#[derive(Default, Debug)]
struct User {
    id: String,
    name: String,
}

fn main() {
    let user = User::default();
    assert_eq!(
        format!("{user:?}"),
        r#"User { id: "", name: "", created_by: 0, updated_by: 0, created_at: 0ns, updated_at: 0ns, is_deleted: false }"#
    );
}
Commit count: 3

cargo fmt