Rust Compile Time ORM robustness,async, pure Rust Dynamic SQL
what changes?
Intercept
set return type -> Result<bool, Error>
to -> Result<Option<bool>, Error>
/// if return None will be return result
/// if return Some(true) will be run next intercept
/// if return Some(false) will be break
what changes?
html_sql
,py_sql
support break
nodeupdate_by_column_skip
, update_by_column_batch_skip
for #501html_sql
,py_sql
the bind
node will set value to arg.rbs
ValueMap use index_map
cratewhat changes?
RBatisConnExecutor
rb_task_id use new_snowflake_id()
what Changes?
"invalid type: integer `1`, expected a string, key=`status`"
)
for example:#toml
rbatis = { version = "4.5", features = ["debug_mode"]}
/// table
#[derive(serde::Serialize, serde::Deserialize)]
pub struct Activity {
pub status: Option<String>,
}
//log
[INFO] [rbatis] [608325834525440517] query <= len=1,rows=[{"status":1}]
called `Result::unwrap()` on an `Err` value: E("invalid type: integer `1`, expected a string, key = `status`")
stack backtrace:
0: std::panicking::begin_panic_handler
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library\std\src\panicking.rs:645
1: core::panicking::panic_fmt
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library\core\src\panicking.rs:72
what change?
what changes?
what changes?
now you can use
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
pub struct Account {
pub id: Option<u64>,
pub name: Option<String>,
}
#[derive(Clone, serde::Serialize, serde::Deserialize)]
pub struct User {
pub id: Option<u64>,
//json support json object/array/null
pub account1: Account,
//json support json object/array/null
pub account2: Vec<Account>,
}
async fn create_table(rb: &RBatis) {
fast_log::LOGGER.set_level(LevelFilter::Off);
defer!(||{
fast_log::LOGGER.set_level(LevelFilter::Info);
});
// let table = User {
// id: Some(1),
// account1: Account {
// id: Some(1),
// name: Some("".to_string()),
// },
// account2: vec![Account {
// id: Some(1),
// name: Some("".to_string()),
// }],
// };
let table = to_value!{
"id":"INTEGER PRIMARY KEY AUTOINCREMENT",
"account1":"JSON",
"account2":"JSON",
};
let conn = rb.acquire().await.unwrap();
_ = table_sync::sync(&conn, &SqliteTableMapper {}, to_value!(&table), "user").await.unwrap();
}
what changes?
impl_select_page
macro issue of failed compilation of ownership parameterswhat changes?
crud
macro Generate the 'snake-case' table name on compile-timewhat changes?
Connection
trait add some translation methodsConnection
trait translation methods