mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 18:18:03 +00:00
core: Add Text::from_str() helper
This commit is contained in:
parent
5abf49a0be
commit
0d318d810e
4 changed files with 15 additions and 16 deletions
|
@ -12,7 +12,7 @@ use crate::json::error::Error as JsonError;
|
|||
pub use crate::json::json_operations::{json_patch, json_remove};
|
||||
use crate::json::json_path::{json_path, JsonPath, PathElement};
|
||||
pub use crate::json::ser::to_string;
|
||||
use crate::types::{Text, OwnedValue, TextSubtype};
|
||||
use crate::types::{OwnedValue, Text, TextSubtype};
|
||||
use indexmap::IndexMap;
|
||||
use jsonb::Error as JsonbError;
|
||||
use ser::to_string_pretty;
|
||||
|
@ -298,7 +298,7 @@ fn convert_json_to_db_type(extracted: &Val, all_as_db: bool) -> crate::Result<Ow
|
|||
Ok(OwnedValue::Integer(0))
|
||||
}
|
||||
}
|
||||
Val::String(s) => Ok(OwnedValue::Text(Text::new(Rc::new(s.clone())))),
|
||||
Val::String(s) => Ok(OwnedValue::Text(Text::from_str(s))),
|
||||
_ => {
|
||||
let json = to_string(&extracted)?;
|
||||
if all_as_db {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue