ThinSQLite++
A thin, safe and convenient modern C++ wrapper for the SQLite API.
Loading...
Searching...
No Matches
SQLite API Wrappers

Classes

class  backup
 Online backup object. More...
class  blob
 Access blob as a byte stream. More...
class  context
 SQL Function Context Object. More...
class  database
 Database Connection. More...
class  error
 Carries information about SQLite error. More...
class  exception
 Exception used to report any SQLite errors. More...
struct  status_value
 Return type for status(). More...
class  keywords
 STL interface to SQLite keywords. More...
class  mutex
 SQLite Mutex. More...
class  snapshot
 A database snapshot. More...
struct  iovec_fallback
 A fallback version of struct iovec for platforms that lack it. More...
class  statement
 Prepared Statement Object. More...
class  value
 Dynamically Typed Value Object. More...
class  sqlite_version
 Representation of SQLite version. More...
class  index_info< T >
 Virtual Table Indexing Information. More...

Typedefs

using iovec = <conditionally declared>
 A portable version of struct iovec that SQLite uses for carray() functionality.

Functions

void initialize ()
 Initialize the SQLite library.
void shutdown () noexcept
 Deinitialize the SQLite library.
status_value status (int op, bool reset=false)
 Obtain SQLite runtime status.
template<int Code, class ... Args>
auto config (Args &&...args) -> void
 Configures SQLite library.
template<class T = struct ::iovec, size_t = sizeof(T)>
constexpr struct ::iovecdetect_iovec (T *)
constexpr auto detect_iovec (...)

Detailed Description


Class Documentation

◆ thinsqlitepp::status_value

struct thinsqlitepp::status_value

Return type for status().

Class Members
typedef sqlite3_int64 counter_type sqlite3_int64
Class Members
counter_type current
counter_type highwater

◆ thinsqlitepp::iovec_fallback

struct thinsqlitepp::iovec_fallback

A fallback version of struct iovec for platforms that lack it.

See also
thinsqlitepp::iovec
Class Members
void * iov_base Base address of a memory region for input or output.
size_t iov_len The size of the memory pointed to by iov_base.

Typedef Documentation

◆ iovec

using iovec = <conditionally declared>

A portable version of struct iovec that SQLite uses for carray() functionality.

On Posix platforms this is a typedef to struct iovec from <sys/uio.h> On other platforms this is a typedef to the thinsqlitepp::iovec_fallback.

Thus, for portability, you can use thinsqlitepp::iovec on any platform

Function Documentation

◆ initialize()

void initialize ( )
inline

Initialize the SQLite library.

Equivalent to sqlite3_initialize

#include <thinsqlitepp/global.hpp>

◆ shutdown()

void shutdown ( )
inlinenoexcept

Deinitialize the SQLite library.

Equivalent to sqlite3_shutdown

#include <thinsqlitepp/global.hpp>

◆ status()

status_value status ( int op,
bool reset = false )
inline

Obtain SQLite runtime status.

Equivalent to sqlite3_status64 or sqlite3_status, if the former is not available

◆ config()

template<int Code, class ... Args>
auto config ( Args &&... args) -> void
inline

Configures SQLite library.

Wraps sqlite3_config

Template Parameters
CodeOne of the SQLITE_CONFIG_ options. Needs to be explicitly specified
Argsdepend on the Code template parameter

#include <thinsqlitepp/global.hpp>

The following table lists required argument types for each option. Supplying wrong argument types will result in compile-time error.

Code Arguments
SQLITE_CONFIG_SINGLETHREAD <none>
SQLITE_CONFIG_MULTITHREAD <none>
SQLITE_CONFIG_SERIALIZED <none>
SQLITE_CONFIG_MALLOC sqlite3_mem_methods *
SQLITE_CONFIG_GETMALLOC sqlite3_mem_methods *
SQLITE_CONFIG_SMALL_MALLOC int
SQLITE_CONFIG_MEMSTATUS int
SQLITE_CONFIG_PAGECACHE void *, int, int
SQLITE_CONFIG_HEAP void *, int, int
SQLITE_CONFIG_MUTEX sqlite3_mutex_methods *
SQLITE_CONFIG_GETMUTEX sqlite3_mutex_methods *
SQLITE_CONFIG_LOOKASIDE int, int
SQLITE_CONFIG_PCACHE2 sqlite3_pcache_methods2 *
SQLITE_CONFIG_GETPCACHE2 sqlite3_pcache_methods2 *
SQLITE_CONFIG_LOG void (*)(void*, int, const char *), void *
SQLITE_CONFIG_URI int
SQLITE_CONFIG_COVERING_INDEX_SCAN int
SQLITE_CONFIG_SQLLOG void (*)(void *, sqlite3 *, const char *, int), void *
SQLITE_CONFIG_MMAP_SIZE int64_t, int64_t
SQLITE_CONFIG_WIN32_HEAPSIZE int
SQLITE_CONFIG_PCACHE_HDRSZ int *
SQLITE_CONFIG_PMASZ unsigned int
SQLITE_CONFIG_STMTJRNL_SPILL int
SQLITE_CONFIG_SORTERREF_SIZE int
SQLITE_CONFIG_MEMDB_MAXSIZE int64_t
SQLITE_CONFIG_ROWID_IN_VIEW int