|
VSQLite++ 0.3
|
Namespaces | |
| namespace | detail |
| namespace | json |
| namespace | fts |
Classes | |
| struct | backup |
| backup is a class for representing SQLite backup operations An object of this class is not copyable More... | |
| struct | named_parameter |
| struct | null_type |
| null_type is an empty type used to represent NULL values More... | |
| struct | command |
| command is the base class of all sql command classes An object of this class is not copyable More... | |
| struct | connection |
| connection is used to open, close, attach and detach a database. Further it has to be passed to all classes since it represents the connection to the database and contains the internal needed handle, so you can see a connection object as handle to the database An object of this class is not copyable More... | |
| class | connection_pool |
| Thread-safe pool for leasing reusable SQLite connections. More... | |
| struct | database_exception |
| Generic runtime failure raised for most SQLite errors. More... | |
| struct | database_exception_code |
| Exception that carries the original SQLite error code and optional SQL snippet. More... | |
| struct | buffer_too_small_exception |
| Raised when a caller-provided buffer is too small to hold a blob/text payload. More... | |
| struct | database_misuse_exception |
| Used for programming errors such as double-closing or using invalidated resources. More... | |
| struct | database_misuse_exception_code |
| Logic-error flavour that also exposes the SQLite status code and SQL string. More... | |
| struct | database_system_error |
| Wraps system-level failures (e.g., file I/O) that bubble up from SQLite APIs. More... | |
| struct | execute |
| execute can be used for SQL commands which should executed the constructor is defined in a way that it can be used like a function An object of this class is not copyable More... | |
| struct | unknown_t |
| struct | null_t |
| struct | filesystem_entry |
| Result of probing a filesystem path that bundles status metadata and the failure code. More... | |
| struct | filesystem_adapter |
| Interface for querying and mutating filesystem paths before SQLite touches them. More... | |
| class | default_filesystem_adapter |
| Default adapter that simply forwards to std::filesystem. More... | |
| struct | function_options |
| Options passed alongside a callable when registering it with sqlite3_create_function_v2. More... | |
| struct | private_accessor |
| A internal used class, shall not be used from users. More... | |
| struct | result_construct_params_private |
| struct | query |
| query should be used to execute SQL queries An object of this class is not copyable More... | |
| struct | result |
| Forward-only cursor over the rows produced by a prepared statement. More... | |
| struct | savepoint |
| this is a helper class to handle transaction savepoints within SQLite More... | |
| struct | session_options |
| Configuration flags supplied when opening a new change session. More... | |
| struct | session |
| RAII wrapper around sqlite3_session. More... | |
| struct | snapshot |
| RAII wrapper around sqlite3_snapshot. More... | |
| struct | statement_cache_config |
| Configuration knobs for the built-in LRU statement cache. More... | |
| class | statement_cache |
| Tracks prepared statements by SQL text and hands them out on demand. More... | |
| struct | transaction |
| transaction is a helper class to start transactions within SQLite More... | |
| struct | view |
| view is used to create views. In SQLite a view can only be queried. INSERT, DELETE and UPDATE will fail on a view More... | |
Typedefs | |
| typedef std::vector< std::uint8_t > | blob_t |
| typedef std::shared_ptr< blob_t > | blob_ref_t |
| typedef std::variant< unknown_t, int, std::int64_t, long double, std::string, null_t, blob_ref_t > | variant_t |
| using | filesystem_adapter_ptr = std::shared_ptr<filesystem_adapter> |
| typedef std::shared_ptr< result > | result_type |
| Shared-pointer alias used by legacy APIs that transfer result ownership. | |
Enumerations | |
| enum class | open_mode { open_readonly , open_existing , open_or_create , always_create } |
| enum | type { unknown , null , integer , real , text , blob } |
| enum class | wal_mode { rollback , truncate , persist , memory , wal , wal2 } |
| enum class | threading_mode { single_thread , multi_thread , serialized } |
| Mirrors the sqlite3_config(SQLITE_CONFIG_*) threading options. More... | |
| enum class | transaction_type { undefined , deferred , immediate , exclusive } |
| Defines the kind of transaction to begin. More... | |
Functions | |
| template<typename T> | |
| named_parameter< std::decay_t< T > > | named (std::string_view name, T &&value) |
| std::string | append_sql_context (std::string message, std::string const &sql) |
| Helper that appends [SQL: ...] context to an existing message. | |
| template<typename Callable> | |
| void | create_function (connection &con, std::string_view name, Callable &&callable, function_options options={}) |
| bool | serialization_supported () noexcept |
| Indicates whether the linked SQLite exposes the serialize/deserialise feature. | |
| std::vector< unsigned char > | serialize (connection &con, std::string_view schema="main", unsigned int flags=0) |
Copies the complete database image for schema into a byte vector. | |
| void | deserialize (connection &con, std::span< const unsigned char > image, std::string_view schema="main", bool read_only=false) |
Replaces the contents of schema with the supplied serialized image. | |
| bool | sessions_supported () noexcept |
| Returns true when SQLite sessions API is available. | |
| void | apply_changeset (connection &con, std::span< const unsigned char > data) |
Applies a changeset produced by session::changeset onto con. | |
| void | apply_patchset (connection &con, std::span< const unsigned char > data) |
Applies a patchset produced by session::patchset onto con. | |
| wal_mode | set_wal_mode (connection &con, wal_mode mode) |
| Force a specific WAL journal mode. | |
| wal_mode | enable_wal (connection &con, bool prefer_wal2=false) |
| Enable WAL, optionally preferring WAL2 with transparent fallback. | |
| wal_mode | get_wal_mode (connection &con) |
| Query the current journal mode for a connection. | |
| std::string_view | to_string (wal_mode mode) |
| Convert wal_mode to the corresponding PRAGMA token. | |
| bool | snapshots_supported () noexcept |
| Check if the linked SQLite library exposes snapshot helpers. | |
| bool | configure_threading (threading_mode mode) |
| Calls sqlite3_config to switch SQLite into the requested threading mode. | |
| threading_mode | current_threading_mode () |
| Returns the currently configured threading_mode. | |
Variables | |
| null_type | nil |
| nil is used instead of NULL within the operator % syntax in this wrapper | |
| typedef std::shared_ptr<blob_t> sqlite::v2::blob_ref_t |
Definition at line 49 of file variant.hpp.
| typedef std::vector<std::uint8_t> sqlite::v2::blob_t |
Definition at line 48 of file variant.hpp.
| using sqlite::v2::filesystem_adapter_ptr = std::shared_ptr<filesystem_adapter> |
Definition at line 76 of file filesystem_adapter.hpp.
| typedef std::shared_ptr<result> sqlite::v2::result_type |
Shared-pointer alias used by legacy APIs that transfer result ownership.
Definition at line 252 of file result.hpp.
| typedef std::variant<unknown_t, int, std::int64_t, long double, std::string, null_t, blob_ref_t> sqlite::v2::variant_t |
Definition at line 52 of file variant.hpp.
|
strong |
Definition at line 51 of file connection.hpp.
|
strong |
Mirrors the sqlite3_config(SQLITE_CONFIG_*) threading options.
Definition at line 46 of file threading.hpp.
|
strong |
Defines the kind of transaction to begin.
When no transaction type is defined (undefined) the default behaviour is to create a deferred transaction, but the undefined constant is because maybe in future the default behaviour may change.
Note that for more type safety this needs Strongly Typed enums C++11 feature: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf
| Enumerator | |
|---|---|
| undefined | |
| deferred | |
| immediate | |
| exclusive | |
Definition at line 64 of file transaction.hpp.
| enum sqlite::v2::type |
| Enumerator | |
|---|---|
| unknown | |
| null | |
| integer | |
| real | |
| text | |
| blob | |
Definition at line 44 of file variant.hpp.
|
strong |
| Enumerator | |
|---|---|
| rollback | DELETE/legacy rollback journal. |
| truncate | |
| persist | |
| memory | |
| wal | |
| wal2 | |
Definition at line 52 of file snapshot.hpp.
|
inline |
Helper that appends [SQL: ...] context to an existing message.
Definition at line 54 of file database_exception.hpp.
Referenced by sqlite::v2::database_exception_code::database_exception_code(), and sqlite::v2::database_misuse_exception_code::database_misuse_exception_code().
| void sqlite::v2::apply_changeset | ( | connection & | con, |
| std::span< const unsigned char > | data ) |
Applies a changeset produced by session::changeset onto con.
| void sqlite::v2::apply_patchset | ( | connection & | con, |
| std::span< const unsigned char > | data ) |
Applies a patchset produced by session::patchset onto con.
| bool sqlite::v2::configure_threading | ( | threading_mode | mode | ) |
Calls sqlite3_config to switch SQLite into the requested threading mode.
| void sqlite::v2::create_function | ( | connection & | con, |
| std::string_view | name, | ||
| Callable && | callable, | ||
| function_options | options = {} ) |
Definition at line 447 of file function.hpp.
| threading_mode sqlite::v2::current_threading_mode | ( | ) |
Returns the currently configured threading_mode.
| void sqlite::v2::deserialize | ( | connection & | con, |
| std::span< const unsigned char > | image, | ||
| std::string_view | schema = "main", | ||
| bool | read_only = false ) |
Replaces the contents of schema with the supplied serialized image.
| con | Connection that should host the deserialized database. |
| image | Serialized bytes previously produced by serialize or another SQLite source. |
| schema | Logical database name. |
| read_only | When true the connection treats the schema as immutable. |
| wal_mode sqlite::v2::enable_wal | ( | connection & | con, |
| bool | prefer_wal2 = false ) |
Enable WAL, optionally preferring WAL2 with transparent fallback.
| wal_mode sqlite::v2::get_wal_mode | ( | connection & | con | ) |
Query the current journal mode for a connection.
| named_parameter< std::decay_t< T > > sqlite::v2::named | ( | std::string_view | name, |
| T && | value ) |
Definition at line 63 of file command.hpp.
|
noexcept |
Indicates whether the linked SQLite exposes the serialize/deserialise feature.
| std::vector< unsigned char > sqlite::v2::serialize | ( | connection & | con, |
| std::string_view | schema = "main", | ||
| unsigned int | flags = 0 ) |
Copies the complete database image for schema into a byte vector.
| con | Open connection whose schema should be serialized. |
| schema | Logical database name (e.g. "main" or "temp"). |
| flags | Optional SQLite serialization flags. |
| database_exception | when serialization is unavailable or fails. |
|
noexcept |
Returns true when SQLite sessions API is available.
| wal_mode sqlite::v2::set_wal_mode | ( | connection & | con, |
| wal_mode | mode ) |
Force a specific WAL journal mode.
|
noexcept |
Check if the linked SQLite library exposes snapshot helpers.
| std::string_view sqlite::v2::to_string | ( | wal_mode | mode | ) |
Convert wal_mode to the corresponding PRAGMA token.
|
extern |
nil is used instead of NULL within the operator % syntax in this wrapper