|
| bool | orbit::orm::detail::is_identifier (std::string_view s) |
| | True for a plain SQL identifier (name) or a qualified one (table.name): ASCII letters, digits and underscores, not starting with a digit. Identifiers cannot be bound as parameters, so anything else is rejected rather than spliced into SQL.
|
| |
| const std::string & | orbit::orm::detail::checked_identifier (const std::string &s) |
| |
| bool | orbit::orm::detail::is_reserved_word (std::string_view s) |
| |
| std::string | orbit::orm::detail::ident (const std::string &name) |
| | Validates an identifier (name or table.name) and marks the parts that are reserved words for quoting.
|
| |
| std::string | orbit::orm::detail::render_identifiers (std::string sql, bool mysql) |
| | Replaces quote marks with " (PostgreSQL, standard SQL) or a backtick (MySQL).
|
| |
| const std::string & | orbit::orm::detail::checked_operator (const std::string &op) |
| |
| template<typename T > |
| std::optional< std::string > | orbit::orm::detail::to_param (const T &val) |
| |
| std::optional< std::string > | orbit::orm::detail::json_to_param (const nlohmann::json &v) |
| |
| std::string | orbit::orm::detail::number_placeholders (const std::string &sql) |
| | Rewrites ? placeholders as PostgreSQL's $1, $2, ...
|
| |
| template<typename Escape > |
| std::string | orbit::orm::detail::inline_literals (const std::string &sql, const Params ¶ms, Escape &&escape) |
| | Replaces ? placeholders with escaped, quoted literals (for clients without parameter binding).
|
| |
| template<typename DBClient > |
| constexpr bool | orbit::orm::is_mysql_client () |
| | Runs sql (with ? placeholders) on either client type.
|
| |
| template<typename DBClient > |
| auto | orbit::orm::do_query_async (std::shared_ptr< DBClient > client, const std::string &sql, const Params ¶ms) |
| |
| void | orbit::orm::detail::throw_if_failed (const database::ResultSet &rs) |
| |
| bool | orbit::orm::detail::is_unset_key (const nlohmann::json &v) |
| | A key that the database should generate: null, 0, or an empty string.
|
| |
| nlohmann::json | orbit::orm::detail::typed_value (const std::string &text, const nlohmann::json &proto) |
| | Converts a column's text to the JSON type of the model field proto.
|
| |
| template<typename ModelType > |
| std::vector< ModelType > | orbit::orm::detail::rows_to_models (const database::ResultSet &rs) |
| | Maps result rows to models, converting each column by the type of the model's field rather than by guessing from its text.
|
| |