db_meta_derive

Crates.iodb_meta_derive
lib.rsdb_meta_derive
version0.1.0
sourcesrc
created_at2024-05-05 04:34:36.730454
updated_at2024-05-05 04:34:36.730454
descriptiondb-meta-derive is a wrapper around PostgresSOL using tokio-postgres
homepagehttps://github.com/ehoac/db_derive
repositoryhttps://github.com/ehoac/db_derive
max_upload_size
id1230028
size27,454
ehoac (ehoac)

documentation

README

db-meta-derive

db-meta-derive is a wrapper around PostgresSOL using tokio-postgres.

Examples

Schema

#[derive(PostgresMapper, Deserialize, PostgresMeta)]
#[pg_mapper(table = "test")]
struct Test {
    #[id]
    id: i64,
    title: Option<String>,
    create_time: Option<SystemTime>,
    update_time: Option<SystemTime>,
}

Usage

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)])
}
Commit count: 0

cargo fmt