mirror of
https://github.com/fluencelabs/fluid
synced 2025-04-24 22:32:16 +00:00
rename bytes to query
This commit is contained in:
parent
3b1d45a4d7
commit
74d57cd408
@ -1,15 +1,15 @@
|
|||||||
use crate::errors::{err_msg, AppResult};
|
use crate::errors::{err_msg, AppResult};
|
||||||
use crate::sqlite;
|
use crate::sqlite;
|
||||||
|
|
||||||
pub fn query(bytes: &str) -> AppResult<String> {
|
pub fn query(query: &str) -> AppResult<String> {
|
||||||
let response = sqlite::call(bytes.as_bytes());
|
let response = sqlite::call(query.as_bytes());
|
||||||
|
|
||||||
// Decode query result to a utf8 string
|
// Decode query result to a utf8 string
|
||||||
String::from_utf8(response).map_err(|e| {
|
String::from_utf8(response).map_err(|e| {
|
||||||
log::error!("unable to decode result from bytes: {:#x?}", bytes);
|
log::error!("unable to decode result from bytes: {:#x?}", bytes);
|
||||||
err_msg(&format!(
|
err_msg(&format!(
|
||||||
"unable to decode result from bytes {:#x?}: {}",
|
"unable to decode result from bytes {:#x?}: {}",
|
||||||
bytes, e
|
query, e
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
use crate::errors::{err_msg, AppResult};
|
use crate::errors::{err_msg, AppResult};
|
||||||
use crate::sqlite;
|
use crate::sqlite;
|
||||||
|
|
||||||
pub fn query(bytes: &str) -> AppResult<String> {
|
pub fn query(query: &str) -> AppResult<String> {
|
||||||
let response = sqlite::call(bytes.as_bytes());
|
let response = sqlite::call(query.as_bytes());
|
||||||
|
|
||||||
// Decode query result to a utf8 string
|
// Decode query result to a utf8 string
|
||||||
String::from_utf8(response).map_err(|e| {
|
String::from_utf8(response).map_err(|e| {
|
||||||
log::error!("unable to decode result from bytes: {:#x?}", bytes);
|
log::error!("unable to decode result from bytes: {:#x?}", bytes);
|
||||||
err_msg(&format!(
|
err_msg(&format!(
|
||||||
"unable to decode result from bytes {:#x?}: {}",
|
"unable to decode result from bytes {:#x?}: {}",
|
||||||
bytes, e
|
query, e
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user