Crates.io | sql-table-macros |
lib.rs | sql-table-macros |
version | |
source | src |
created_at | 2024-11-16 21:43:06.859204 |
updated_at | 2024-11-16 22:09:14.94391 |
description | Helper macros to generate SQL table definitions |
homepage | |
repository | https://github.com/qyuzh/sql-table-macros |
max_upload_size | |
id | 1450694 |
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` |
size | 0 |
Helper macros to auto add sql table common fields to struct definition
#![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 }"#
);
}