#include <ValidationSqliteUtil.h>
|
static size_t | getNumberOfTableRows (SqliteConnection &connection, std::string_view attachedDbName, std::string_view tableName, const ALLOC &allocator) |
|
static void | getTableSchema (SqliteConnection &connection, std::string_view attachedDbName, std::string_view tableName, TableSchema &tableSchema, const ALLOC &allocator) |
|
static bool | isColumnInTable (SqliteConnection &connection, std::string_view attachedDbName, std::string_view tableName, std::string_view columnName, const ALLOC &allocator) |
|
static const char * | sqliteColumnTypeName (int columnType) |
|
template<typename ALLOC>
struct zserio::ValidationSqliteUtil< ALLOC >
Sqlite utility for validation.
Definition at line 17 of file ValidationSqliteUtil.h.
◆ Statement
template<typename ALLOC >
◆ StringType
template<typename ALLOC >
◆ TableSchema
template<typename ALLOC >
◆ getNumberOfTableRows()
template<typename ALLOC >
Gets number of rows in the given SQLite table.
- Parameters
-
connection | Database connection to use. |
attachedDbName | Attached database name if table is relocated in different database. |
tableName | Name of the table to get column types of. |
allocator | Allocator to use for the query string composition. |
- Returns
- Number of rows.
- Exceptions
-
Definition at line 48 of file ValidationSqliteUtil.h.
◆ getTableSchema()
template<typename ALLOC >
Gets a map of column names to column description for given SQLite table.
- Parameters
-
connection | Database connection to use. |
attachedDbName | Attached database name if table is relocated in different database. |
tableName | Name of the table to get column types of. |
tableSchema | Schema to fill. |
allocator | Allocator to use for the query string composition. |
Definition at line 80 of file ValidationSqliteUtil.h.
◆ isColumnInTable()
template<typename ALLOC >
Check if the column is present in the given SQLite table. Note that this method also detect hidden SQLite columns, which are not visible using standard PRAGMA table_info query.
- Parameters
-
connection | Database connection to use. |
attachedDbName | Attached database name if table is relocated in different database. |
tableName | Name of the table to get column types of. |
columnName | Name of the column to check. |
allocator | Allocator to use for the query string composition. |
- Returns
- Returns true if the column is present in the table, even if the column is hidden. Otherwise returns false.
Definition at line 129 of file ValidationSqliteUtil.h.
◆ sqliteColumnTypeName()
template<typename ALLOC >
Gets name of the given SQLite column type.
- Parameters
-
columnType | SQLite column type. |
- Returns
- SQLite column type name.
Definition at line 163 of file ValidationSqliteUtil.h.
The documentation for this struct was generated from the following file: