Crates.io | db_meta_derive |
lib.rs | db_meta_derive |
version | 0.1.0 |
source | src |
created_at | 2024-05-05 04:34:36.730454 |
updated_at | 2024-05-05 04:34:36.730454 |
description | db-meta-derive is a wrapper around PostgresSOL using tokio-postgres |
homepage | https://github.com/ehoac/db_derive |
repository | https://github.com/ehoac/db_derive |
max_upload_size | |
id | 1230028 |
size | 27,454 |
db-meta-derive is a wrapper around PostgresSOL using tokio-postgres.
#[derive(PostgresMapper, Deserialize, PostgresMeta)]
#[pg_mapper(table = "test")]
struct Test {
#[id]
id: i64,
title: Option<String>,
create_time: Option<SystemTime>,
update_time: Option<SystemTime>,
}
pub fn test() {
let meta = Test::meta();
println!("{:?}", meta);
// ("test", [("id", "bigserial primary key", 0, "", true), ("title", "varchar", 0, "", false), ("create_time", "timestamp", 0, "", false), ("update_time", "timestamp", 0, "", false)])
}