Replies: 2 comments 4 replies
-
改成Vec就不会报错,impl_select!(BlockScan{select_by_tag(tag:&str) -> Vec => " |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
使用版本:
rbs = { version = "4.5"}
rbatis = { version = "4.5",features = []}
rbdc-mysql= { version="4.5" }
reqwest = { version = "0.12", features = ["json"] }
impl_select!(BlockScan{select_by_tag(tag:&str) -> Option => "
where tag = #{tag} limit 1
"});let list = BlockScan::select_by_tag(&mut GLOBAL_DB.clone(), tag).await;
println!("select_by_id = {}", json!(list));
#[derive(Clone, Debug, Serialize, Deserialize,Default)]
#[serde(default)]
pub struct BlockScan {
pub id: Option,
pub tag: Option,
pub block_number: Option,
}
报错如下:
select_by_id = {"Err":{"E":"invalid type: map, expected i32"}}
Beta Was this translation helpful? Give feedback.
All reactions