pub struct JsonPath {
pub column: String,
pub segments: Vec<PathSegment>,
pub as_text: bool,
}Expand description
A JSON path expression for navigating JSON documents.
Fields§
§column: StringThe column name containing JSON.
segments: Vec<PathSegment>Path segments (field names or array indices).
as_text: boolWhether to return text (::text in PostgreSQL).
Implementations§
Source§impl JsonPath
impl JsonPath
Sourcepub fn from_path(column: impl Into<String>, path: &str) -> Self
pub fn from_path(column: impl Into<String>, path: &str) -> Self
Create a path from a JSONPath string (e.g., “$.user.name”).
Sourcepub fn to_postgres_expr(&self) -> String
pub fn to_postgres_expr(&self) -> String
Convert to PostgreSQL JSON path expression.
Sourcepub fn to_mysql_expr(&self) -> String
pub fn to_mysql_expr(&self) -> String
Convert to MySQL JSON path expression.
Sourcepub fn to_sqlite_expr(&self) -> String
pub fn to_sqlite_expr(&self) -> String
Convert to SQLite JSON path expression.
Sourcepub fn to_mssql_expr(&self) -> String
pub fn to_mssql_expr(&self) -> String
Convert to MSSQL JSON path expression.
Sourcepub fn to_jsonpath_string(&self) -> String
pub fn to_jsonpath_string(&self) -> String
Convert to standard JSONPath string.
Sourcepub fn to_mongodb_path(&self) -> String
pub fn to_mongodb_path(&self) -> String
Convert to MongoDB dot notation.
Sourcepub fn to_sql(&self, db_type: DatabaseType) -> String
pub fn to_sql(&self, db_type: DatabaseType) -> String
Convert to SQL expression for the specified database.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for JsonPath
impl<'de> Deserialize<'de> for JsonPath
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a> From<&'a JsonPath> for JsonPathRef<'a>
impl<'a> From<&'a JsonPath> for JsonPathRef<'a>
impl Eq for JsonPath
impl StructuralPartialEq for JsonPath
Auto Trait Implementations§
impl Freeze for JsonPath
impl RefUnwindSafe for JsonPath
impl Send for JsonPath
impl Sync for JsonPath
impl Unpin for JsonPath
impl UnwindSafe for JsonPath
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more