|
VSQLite++ 0.3
|
Classes | |
| class | path_builder |
| Helper for composing JSON path expressions compatible with SQLite's JSON1 dialect. More... | |
Functions | |
| path_builder | path () |
| Convenience shortcut for starting a new JSON path builder rooted at $. | |
| std::string | extract_expression (std::string_view json_expr, path_builder const &path) |
| Produces a SQL expression that extracts a JSON value at the given path. | |
| std::string | contains_expression (std::string_view json_expr, path_builder const &path, std::string_view value_expr) |
Produces a SQL expression that compares a JSON value at path with value_expr. | |
| bool | available (connection &con) |
| Detects whether the connected SQLite build exposes the JSON1 extension. | |
| void | register_contains_function (connection &con, std::string_view function_name="json_contains_value") |
| Registers a deterministic SQL scalar function that checks for JSON containment. | |
| bool sqlite::v2::json::available | ( | connection & | con | ) |
Detects whether the connected SQLite build exposes the JSON1 extension.
| std::string sqlite::v2::json::contains_expression | ( | std::string_view | json_expr, |
| path_builder const & | path, | ||
| std::string_view | value_expr ) |
Produces a SQL expression that compares a JSON value at path with value_expr.
This expands to json_extract(json_expr, path) = value_expr so it can be embedded inside WHERE clauses or CHECK constraints.
References path().

| std::string sqlite::v2::json::extract_expression | ( | std::string_view | json_expr, |
| path_builder const & | path ) |
Produces a SQL expression that extracts a JSON value at the given path.
| json_expr | SQL expression that yields JSON text. |
| path | JSON path built with path_builder. |
References path().

|
inline |
Convenience shortcut for starting a new JSON path builder rooted at $.
Definition at line 91 of file json_fts.hpp.
Referenced by contains_expression(), and extract_expression().
| void sqlite::v2::json::register_contains_function | ( | connection & | con, |
| std::string_view | function_name = "json_contains_value" ) |
Registers a deterministic SQL scalar function that checks for JSON containment.
| con | Open connection that already enabled JSON1. |
| function_name | Optional SQL symbol name (defaults to json_contains_value). |
| database_exception | when JSON1 is unavailable or the function cannot be created. |