|
Botan 3.13.0
Crypto and TLS for C&
|
#include <sqlite3.h>
Public Types | |
| enum class | Column_Type : uint8_t { Blob , String , Integer } |
Public Member Functions | |
| void | create_table (const Table_Schema &schema) override |
| virtual size_t | exec (std::string_view sql) |
| bool | is_threadsafe () const override |
| virtual bool | is_valid_table_name (std::string_view table) const |
| std::shared_ptr< Statement > | new_statement (std::string_view sql) const override |
| Sqlite3_Database & | operator= (const Sqlite3_Database &other)=delete |
| Sqlite3_Database & | operator= (Sqlite3_Database &&other)=delete |
| size_t | row_count (std::string_view table_name) override |
| size_t | rows_changed_by_last_statement () override |
| virtual std::shared_ptr< Statement > | select (std::string_view columns, std::string_view table, std::string_view where={}, std::optional< size_t > limit=std::nullopt) const |
| Sqlite3_Database (const Sqlite3_Database &other)=delete | |
| Sqlite3_Database (Sqlite3_Database &&other)=delete | |
| BOTAN_FUTURE_EXPLICIT | Sqlite3_Database (std::string_view file, std::optional< int > sqlite_open_flags=std::nullopt) |
| std::shared_ptr< Statement > | upsert (std::string_view table, std::initializer_list< std::string_view > columns) const override |
| ~Sqlite3_Database () override | |
An SQL_Database implementation backed by SQLite3
|
stronginherited |
The supported column types
| Enumerator | |
|---|---|
| Blob | |
| String | |
| Integer | |
Definition at line 196 of file database.h.
| Botan::Sqlite3_Database::Sqlite3_Database | ( | std::string_view | file, |
| std::optional< int > | sqlite_open_flags = std::nullopt ) |
Create a new SQLite database handle from a file.
| file | path to the database file be opened and/or created |
| sqlite_open_flags | flags that will be passed to sqlite3_open_v2() (default: SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_FULLMUTEX) |
Definition at line 18 of file sqlite3.cpp.
Referenced by operator=(), operator=(), Sqlite3_Database(), and Sqlite3_Database().
|
overridedefault |
|
delete |
References Sqlite3_Database().
|
delete |
References Sqlite3_Database().
|
overridevirtual |
Create a table
| schema | the name and columns of the table to create |
Implements Botan::SQL_Database.
Definition at line 78 of file sqlite3.cpp.
References Botan::SQL_Database::Blob, BOTAN_ARG_CHECK, Botan::SQL_Database::Table_Schema::columns(), Botan::SQL_Database::Integer, Botan::SQL_Database::Table_Schema::is_if_not_exists(), Botan::SQL_Database::Table_Schema::name(), and Botan::SQL_Database::String.
Referenced by operator=().
|
inlinevirtualinherited |
Prepare and run a statement to completion
| sql | the SQL text to execute |
Definition at line 342 of file database.h.
References new_statement().
|
overridevirtual |
Query whether this database may be used from multiple threads
Reimplemented from Botan::SQL_Database.
Definition at line 135 of file sqlite3.cpp.
Referenced by operator=().
|
virtualinherited |
Return true if the given name seems to be valid as the name for a table
Default implementation accepts non-empty [a-zA-Z0-9_]
| table | the name to check |
Definition at line 14 of file database.cpp.
References Botan::CharacterValidityTable::alpha_numeric_plus().
|
overridevirtual |
Create a new statement for execution
| sql | the SQL text of the statement |
Implements Botan::SQL_Database.
Definition at line 37 of file sqlite3.cpp.
Referenced by operator=(), row_count(), and upsert().
|
delete |
References Sqlite3_Database().
Referenced by operator=().
|
delete |
|
overridevirtual |
Count the rows of a table
| table_name | the table to count |
Implements Botan::SQL_Database.
Definition at line 68 of file sqlite3.cpp.
References Botan::fmt(), and new_statement().
Referenced by operator=().
|
overridevirtual |
Count the rows modified by the most recently executed statement
Implements Botan::SQL_Database.
Definition at line 129 of file sqlite3.cpp.
References BOTAN_ASSERT_NOMSG.
Referenced by operator=().
|
virtualinherited |
Prepare a "SELECT <columns> FROM <table> [WHERE <where>] [LIMIT <limit>]" statement. where is the body of the WHERE clause (e.g. "id = ?1 AND name = ?2"); pass an empty string for no WHERE clause. Use ?1, ?2, ... for bound parameters. Virtual so backends can override if helpful.
| columns | the columns to select |
| table | the table to select from |
| where | the body of the WHERE clause, or empty for no WHERE clause |
| limit | the maximum number of rows, or nullopt for no limit |
Definition at line 28 of file database.cpp.
References new_statement().
Referenced by new_statement().
|
overridevirtual |
Prepare an insert-or-replace statement
| table | the table to upsert into |
| columns | the columns to write, in placeholder order |
Implements Botan::SQL_Database.
Definition at line 41 of file sqlite3.cpp.
References BOTAN_ARG_CHECK, Botan::fmt(), and new_statement().
Referenced by operator=().