Zserio C++ runtime library
1.2.0
Built for Zserio 2.16.0
|
#include <ValidationSqliteUtil.h>
Classes | |
struct | ColumnDescription |
Public Types | |
using | string_type = string< ALLOC > |
using | Statement = std::unique_ptr< sqlite3_stmt, SqliteFinalizer > |
using | TableSchema = std::map< string_type, ColumnDescription, std::less< string_type >, RebindAlloc< ALLOC, std::pair< const string_type, ColumnDescription > >> |
Static Public Member Functions | |
static size_t | getNumberOfTableRows (SqliteConnection &connection, StringView attachedDbName, StringView tableName, const ALLOC &allocator) |
static void | getTableSchema (SqliteConnection &connection, StringView attachedDbName, StringView tableName, TableSchema &tableSchema, const ALLOC &allocator) |
static bool | isColumnInTable (SqliteConnection &connection, StringView attachedDbName, StringView tableName, StringView columnName, const ALLOC &allocator) |
static const char * | sqliteColumnTypeName (int columnType) |
Sqlite utility for validation.
Definition at line 17 of file ValidationSqliteUtil.h.
using zserio::ValidationSqliteUtil< ALLOC >::Statement = std::unique_ptr<sqlite3_stmt, SqliteFinalizer> |
Definition at line 20 of file ValidationSqliteUtil.h.
using zserio::ValidationSqliteUtil< ALLOC >::string_type = string<ALLOC> |
Definition at line 19 of file ValidationSqliteUtil.h.
using zserio::ValidationSqliteUtil< ALLOC >::TableSchema = std::map<string_type, ColumnDescription, std::less<string_type>, RebindAlloc<ALLOC, std::pair<const string_type, ColumnDescription> >> |
Definition at line 33 of file ValidationSqliteUtil.h.
|
inlinestatic |
Gets number of rows in the given SQLite table.
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. |
SqliteException | if the table does not exist. |
Definition at line 48 of file ValidationSqliteUtil.h.
|
inlinestatic |
Gets a map of column names to column description for given SQLite table.
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.
|
inlinestatic |
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.
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. |
Definition at line 129 of file ValidationSqliteUtil.h.
|
inlinestatic |
Gets name of the given SQLite column type.
columnType | SQLite column type. |
Definition at line 163 of file ValidationSqliteUtil.h.