Lines Matching refs:datas
43 fn bind_datas(datas: &DbMap, stmt: &Statement, index: &mut i32) -> Result<()> {
44 for (_, value) in datas.iter() {
51 fn bind_where_datas(datas: &DbMap, stmt: &Statement, index: &mut i32) -> Result<()> {
52 for (key, value) in datas.iter() {
63 fn bind_where_with_specific_condifion(datas: &[Value], stmt: &Statement, index: &mut i32) -> Result<()> {
64 for value in datas.iter() {
281 /// Insert a row into table, and datas is the value to be insert.
287 /// let datas = &DbMap::from([("id", Value::Number(3), ("alias", Value::Bytes(b"alias1"))]);
288 /// let ret = table.insert_row(datas);
290 pub(crate) fn insert_row(&self, datas: &DbMap) -> Result<i32> {
292 for (i, column_name) in datas.keys().enumerate() {
294 if i != datas.len() - 1 {
300 build_sql_values(datas.len(), &mut sql);
304 bind_datas(datas, &stmt, &mut index)?;
331 if let Some(datas) = reverse_condition {
332 bind_datas(datas, &stmt, &mut index)?;
366 /// let datas = &DbMap::from([("alias", Value::Bytes(b"update_value")]);
367 /// let ret = table.update_row(conditions, false, datas);
369 pub(crate) fn update_row(&self, condition: &DbMap, is_filter_sync: bool, datas: &DbMap) -> Result<i32> {
371 for (i, column_name) in datas.keys().enumerate() {
374 if i != datas.len() - 1 {
381 bind_datas(datas, &stmt, &mut index)?;
441 /// Count the number of datas with query condition(can be empty).
515 pub(crate) fn replace_row(&self, condition: &DbMap, is_filter_sync: bool, datas: &DbMap) -> Result<()> {
518 if self.delete_row(condition, None, is_filter_sync).is_ok() && self.insert_row(datas).is_ok() {