SQLiteXX  0.1.0
 All Classes Namespaces Files Functions Enumerations Enumerator
Classes | Enumerations | Functions
sqlite Namespace Reference

SQLiteXX classes and functions are defined in this namespace. More...

Classes

class  backup
 Used to aid in the process of backing up a database. More...
 
class  blob
 A "Binary Large OBject". More...
 
class  dbconnection
 Class that represents a connection to a database. More...
 
class  exception
 Encapsulation of the error code and message from SQLite3, based on std::runtime_error. More...
 
class  busy_exception
 Encapsulation of the SQLITE_BUSY error code derived from SQLite::Exception. More...
 
class  mutex
 Helps with serializing access to a database connection. More...
 
class  reader
 Base class used to help with reading "sqlite3_stmt" information. More...
 
class  row
 Represents a returned row when stepping through a "SELECT" statement. More...
 
class  statement
 Represents a single SQL statement that has been compiled into binary form and is ready to be evaluated, aka "sqlite3_stmt". More...
 
class  row_iterator
 Helps when iterating over rows in a "SELECT" statement. More...
 
class  transaction
 RAII encapsulation of the SQLite Transactions. More...
 
class  deferred_transaction
 RAII encapsulation of the SQLite deferred transaction. More...
 
class  immediate_transaction
 RAII encapsulation of the SQLite immediate transaction. More...
 
class  exclusive_transaction
 RAII encapsulation of the SQLite exclusive transaction. More...
 
class  value
 A SQLite dynamically typed value object, aka "sqlite3_value". More...
 

Enumerations

enum  openmode : int {
  openmode::read_only = SQLITE_OPEN_READONLY, openmode::read_write = SQLITE_OPEN_READWRITE, openmode::create = SQLITE_OPEN_CREATE, openmode::uri = SQLITE_OPEN_URI,
  openmode::memory = SQLITE_OPEN_MEMORY, openmode::no_mutex = SQLITE_OPEN_NOMUTEX, openmode::full_mutex = SQLITE_OPEN_FULLMUTEX, openmode::shared_cache = SQLITE_OPEN_SHAREDCACHE,
  openmode::private_cache = SQLITE_OPEN_PRIVATECACHE
}
 Different ways to open a dbconnection. More...
 
enum  datatype : int {
  datatype::integer = SQLITE_INTEGER, datatype::floating = SQLITE_FLOAT, datatype::blob = SQLITE_BLOB, datatype::null = SQLITE_NULL,
  datatype::text = SQLITE3_TEXT
}
 Every value in SQLite has one of the following fundamental datatypes. More...
 
enum  bindtype : int { bindtype::statically, bindtype::transiently }
 Used to specify the way to bind a value to a statement. More...
 
enum  transactiontype : int { transactiontype::deferred, transactiontype::immediate, transactiontype::exclusive }
 Used to specify the different types of SQLite transactions. More...
 

Functions

void return_result (sqlite3_context *context, int value)
 Helpers for setting result of scalar functions.
 
row_iterator begin (const statement &statement) noexcept
 Returns an iterator to the first row of a statement. More...
 
row_iterator end (const statement &statement) noexcept
 Returns an iterator to the end. More...
 
template<typename... Values>
int execute (const dbconnection &connection, const std::string &text, Values &&...values)
 Executes an SQL query on a database connection. More...
 
template<typename... Values>
int execute (const dbconnection &connection, const std::u16string &text, Values &&...values)
 Executes an SQL query on a database connection. More...
 

Detailed Description

SQLiteXX classes and functions are defined in this namespace.

Enumeration Type Documentation

enum sqlite::bindtype : int
strong

Used to specify the way to bind a value to a statement.

Enumerator
statically 

means that the content pointer is constant and will never change.

transiently 

means that the content will likely change in the near future and that SQLite should make its own private copy of the content before returning.

Definition at line 23 of file SQLiteEnums.h.

enum sqlite::datatype : int
strong

Every value in SQLite has one of the following fundamental datatypes.

Enumerator
integer 

64-bit signed integer

floating 

64-bit IEEE floating point number

blob 

a group and bits

null 

NULL.

text 

a string

Definition at line 13 of file SQLiteEnums.h.

enum sqlite::openmode : int
strong

Different ways to open a dbconnection.

Enumerator
read_only 

opened in read-only mode

read_write 

opened for reading and writing if possible, or reading only if the file is write protected by the operating system.

create 

database will be created if it does not already exist

uri 

URI filename interpretation is enabled.

memory 

open an in memory database

no_mutex 

database connections opens in the multi-thread threading mode as long as the single-thread mode has not been set at compile-time or start-time

full_mutex 

database connection opens in the serialized threading mode unless single-thread was previously selected at compile-time or start-time.

shared_cache 

causes the database connection to be eligible to use shared cache mode, regardless of whether or not shared cache is enabled.

private_cache 

causes the database connection to not participate in shared cache mode even if it is enabled.

Definition at line 14 of file Open.h.

enum sqlite::transactiontype : int
strong

Used to specify the different types of SQLite transactions.

Enumerator
deferred 

means that no locks are acquired on the database until the database is first accessed.

immediate 

means that no database connection will be able to write to the database or do a BEGIN IMMEDIATE/EXCLUSIVE.

exclusive 

means that no other database connection except for read_uncommitted connection will be able to read/write to the database.

Definition at line 17 of file Transaction.h.

Function Documentation

row_iterator sqlite::begin ( const statement &  statement)
noexcept

Returns an iterator to the first row of a statement.

Parameters
[in]statementthe statement to get the first row of
Returns
The first row of an executed SQL statement.

Definition at line 6 of file Statement.cpp.

row_iterator sqlite::end ( const statement &  statement)
noexcept

Returns an iterator to the end.

Parameters
[in]statementthe statement to get the end of
Returns
The value that signifies that there are no more rows to iterate over.

Definition at line 11 of file Statement.cpp.

template<typename... Values>
int sqlite::execute ( const dbconnection &  connection,
const std::string &  text,
Values &&...  values 
)
inline

Executes an SQL query on a database connection.

Parameters
[in]connectiona database connection to execute the statement on
[in]textthe SQL query
[in]valuespossible values to bind to SQL query if containing bind parameters

Definition at line 642 of file Statement.h.

template<typename... Values>
int sqlite::execute ( const dbconnection &  connection,
const std::u16string &  text,
Values &&...  values 
)
inline

Executes an SQL query on a database connection.

Parameters
[in]connectiona database connection to execute the statement on
[in]textUTF-16 SQL query
[in]valuespossible values to bind to SQL query if containing bind parameters

Definition at line 657 of file Statement.h.