You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Connection.prepare(sql);
create_statement.execute_query(&arg_array);Err(General("Couldn\'t convert the value `Date(\"\\\'2019-12-12\\\'\")` to a desired type"))
mysql data row
date `2019-12-12 00:00:00`
so i check the code. maybe you need add a mothed support the date. and i use this code ,query date success.
//just like /// Result set from executing a query against a statementpubtraitResultSet{/// get meta data about this result setfnmeta_data(&self) -> Result<Box<dynResultSetMetaData>>;/// Move the cursor to the next available row if one exists and return true if it doesfnnext(&mutself) -> bool;fnget_i8(&self,i:u64) -> Result<Option<i8>>;fnget_i16(&self,i:u64) -> Result<Option<i16>>;fnget_i32(&self,i:u64) -> Result<Option<i32>>;fnget_i64(&self,i:u64) -> Result<Option<i64>>;fnget_f32(&self,i:u64) -> Result<Option<f32>>;fnget_f64(&self,i:u64) -> Result<Option<f64>>;fnget_string(&self,i:u64) -> Result<Option<String>>;fnget_bytes(&self,i:u64) -> Result<Option<Vec<u8>>>;fnget_date(&self,i:u64) -> Result<Option<String>>;// this code impl to support date}
impl<'a>MySQLResultSet<'a>{fnget_my_date(&self,i:u64) -> Result<Option<my::Value>,Error>{match&self.row{Some(Ok(row)) => row
.get_opt(i asusize).expect("we will never `take` the value so the outer `Option` is always `Some`").map(|v| Some(v)).map_err(value_to_rdbc_err),
_ => Ok(None),}}}//get_date implimpl<'a> rdbc::ResultSetforMySQLResultSet<'a>{fnget_date(&self,i:u64) -> Result<Option<String>,Error>{let date=self.get_my_date(i)?;if date.is_some(){let v=date.unwrap();returnOk(Option::from(v.as_sql(true)));}else{returnOk(None);}}}
The text was updated successfully, but these errors were encountered:
zhuxiujia
changed the title
prepared Statement select date fail in Mysql error.but create Statement is success.
prepared Statement select convert date fail in Mysql error.but create Statement is success.
Jan 22, 2020
zhuxiujia
changed the title
prepared Statement select convert date fail in Mysql error.but create Statement is success.
prepared Statement Convert Date Type fail in Mysql error.but create Statement is success.
Jan 22, 2020
so i check the code. maybe you need add a mothed support the date. and i use this code ,query date success.
The text was updated successfully, but these errors were encountered: