rbatis-tools

Generate the RUST structure based on the MySQL table structure

Version info Downloads docs dependency status

Install

cargo install rbatis-tools

Exec

rbatis-tools mysql -f reverse.yml

Example

use serde_derive;
use chrono::prelude::*;

#[crud_table]
#[derive(Default, Debug, Clone, PartialEq, serde_derive::Serialize, serde_derive::Deserialize)]
/// Test
pub struct Test {
    pub id: Option<u32>,
    /// uuid
    pub uuid: Option<String>,
    /// 数据
    pub content: Option<String>,
    /// 版本
    pub version: Option<i8>,
    /// 1:删除, 0:未删除
    pub is_deleted: Option<u8>,
    /// 更新时间
    pub updated_at: Option<NaiveDateTime>,
    /// 创建时间
    pub created_at: Option<NaiveDateTime>,
}