libsl3 1.2.41002
A C++ interface for SQLite
|
Namespace of libSL3. More...
Classes | |
class | Columns |
Class to access data of query results. More... | |
class | Command |
A compiled SQL command. More... | |
class | Container |
Wrapper to provide begin, end and random access of a container. More... | |
class | Database |
represents a SQLite3 Database More... | |
class | Dataset |
A utility for processing the result queries. More... | |
class | DbValue |
This class models the duck typing sqlite uses. It supports int, real, text, blob and null values. More... | |
class | DbValues |
A row of DbValues. More... | |
class | Error |
Exception base type. More... | |
class | ErrType |
Object class representing an ErrCode. More... | |
class | ErrType< ErrCode::SQL3Error > |
packaging an error from sqlite3. This exception will be thrown if sqlite3 reports an error. More... | |
class | RowCallback |
Callback for SQL Select statements. More... | |
class | Types |
A Container holding sl3::Type values. More... | |
class | Value |
This class models the duck typing sqlite uses. It supports int, real, text, blob and null values. More... | |
Typedefs | |
using | ErrNoConnection = ErrType< ErrCode::NoConnection > |
error that will be thrown if no open database was available but needed | |
using | ErrOutOfRange = ErrType< ErrCode::OutOfRange > |
thrown if an index op is out of range | |
using | ErrTypeMisMatch = ErrType< ErrCode::TypeMisMatch > |
thrown in case of an incorrect type usage | |
using | ErrNullValueAccess = ErrType< ErrCode::NullValueAccess > |
thrown in case of accessing a Null value field/parameter | |
using | ErrUnexpected = ErrType< ErrCode::UNEXPECTED > |
using | SQLite3Error = ErrType< ErrCode::SQL3Error > |
Alias for ErrType<ErrCode::SQL3Error> | |
using | Blob = std::vector< std::byte > |
Enumerations | |
enum class | ErrCode { SQL3Error = 1 , NoConnection = 2 , OutOfRange = 5 , TypeMisMatch = 6 , NullValueAccess = 7 , UNEXPECTED = 99 } |
Error codes. More... | |
enum class | Type { Null = 0 , Int = 1 , Real = 2 , Text = 3 , Blob = 4 , Variant = 5 } |
Functions | |
template<typename... VALS> | |
DbValues | parameters (VALS &&... vals) |
Syntax sugar to create command parameters. | |
const char * | sqliteCompiledVersion () |
sqlite version string at compile time | |
int | sqliteCompiledVersionNumber () |
sqlite version number at compile time | |
const char * | sqliteRuntimeVersion () |
sqlite version string at runtime | |
int | sqliteRuntimeVersionNumber () |
sqlite version number at compile time | |
int | sqliteThreadSafeCompileOption () |
returns value of SQLITE_THREADSAFE compilation option | |
std::string | getErrStr (int errcode) |
Wraps sqlite3_errstr() function. | |
LIBSL3_API std::ostream & | operator<< (std::ostream &stm, const sl3::DbValue &v) |
Stream op for a DbValue. | |
bool | dbval_type_eq (const DbValue &a, const DbValue &b) noexcept |
equality, including type info | |
bool | dbval_type_lt (const DbValue &a, const DbValue &b) noexcept |
less than, including type info | |
bool | dbval_eq (const DbValue &a, const DbValue &b) noexcept |
equality, ignoring type info | |
bool | dbval_lt (const DbValue &a, const DbValue &b) noexcept |
less than, ignoring type info | |
void | swap (DbValues &a, DbValues &b) noexcept |
DbValue specialized swap function. | |
constexpr const char * | ErrCodeName (ErrCode ec) |
get textual representantion (the name) of an ErrCode | |
LIBSL3_API std::ostream & | operator<< (std::ostream &os, const Error &e) |
overloaded stream operator | |
std::string | typeName (Type) |
Get the type name as string. | |
std::ostream &LIBSL3_API | operator<< (std::ostream &os, const Type &t) |
overloaded stream operator for sl3::Type | |
std::ostream & | operator<< (std::ostream &stm, const sl3::Value &v) |
Stream op for a Value. | |
bool | value_type_eq (const Value &a, const Value &b) noexcept |
equality, including type info | |
bool | value_type_lt (const Value &a, const Value &b) noexcept |
less than, including type info | |
bool | value_eq (const Value &a, const Value &b) noexcept |
equality, ignoring type info | |
bool | value_lt (const Value &a, const Value &b) noexcept |
less than, ignoring type info | |
void | swap (Value &a, Value &b) noexcept |
Value specialized swap function. | |
Namespace of libSL3.
The namespace where the library defines it's elements.
using sl3::Blob = typedef std::vector<std::byte> |
A type for binary data
using sl3::ErrNoConnection = typedef ErrType<ErrCode::NoConnection> |
error that will be thrown if no open database was available but needed
using sl3::ErrNullValueAccess = typedef ErrType<ErrCode::NullValueAccess> |
thrown in case of accessing a Null value field/parameter
using sl3::ErrOutOfRange = typedef ErrType<ErrCode::OutOfRange> |
thrown if an index op is out of range
using sl3::ErrTypeMisMatch = typedef ErrType<ErrCode::TypeMisMatch> |
thrown in case of an incorrect type usage
using sl3::ErrUnexpected = typedef ErrType<ErrCode::UNEXPECTED> |
thrown if something unexpected happened, mostly used by test tools and in debug mode
using sl3::SQLite3Error = typedef ErrType<ErrCode::SQL3Error> |
Alias for ErrType<ErrCode::SQL3Error>
A short alias for an ErrType<ErrCode::SQL3Error>
|
strong |
Error codes.
These enum values used to create ErrType objects.
Each ErrCode becomes an ErrType object.
|
strong |
equality, ignoring type info
Compares only the stored value for equality and ignores type information.
a | first value to compare |
b | second value to compare |
less than, ignoring type info
Compares only the stored value and ignores type information.
a | first value to compare |
b | second value to compare |
equality, including type info
Check if 2 DbValue instances are of the same type and of the same value.
a | first value to compare |
b | second value to compare |
less than, including type info
Applies following rules which are equal to the sorting rules of sqlite.
Type::Text is less than Type::Blob
The type used is DbValue.getStorageType.
The comparison of the value itself is implemented via std::less.
a | first value to compare |
b | second value to compare |
|
constexpr |
get textual representantion (the name) of an ErrCode
ec | wanted ErrCode name |
std::string sl3::getErrStr | ( | int | errcode | ) |
Wraps sqlite3_errstr() function.
The sqlite3_errstr() interface returns the English-language text that describes the result code, as UTF
errcode | err number |
LIBSL3_API std::ostream & sl3::operator<< | ( | std::ostream & | os, |
const Error & | e | ||
) |
std::ostream &LIBSL3_API sl3::operator<< | ( | std::ostream & | os, |
const Type & | t | ||
) |
LIBSL3_API std::ostream & sl3::operator<< | ( | std::ostream & | stm, |
const sl3::DbValue & | v | ||
) |
std::ostream & sl3::operator<< | ( | std::ostream & | stm, |
const sl3::Value & | v | ||
) |
DbValues sl3::parameters | ( | VALS &&... | vals | ) |
Syntax sugar to create command parameters.
Creates DbValues with types based on the given arguments.
Will create DbValues of Type::Int, Type::Text and Type::Real
VALS | variadic argument types |
vals | variadic argument values |
const char * sl3::sqliteCompiledVersion | ( | ) |
sqlite version string at compile time
if this library was linked against an installed version of sqlite this function can be used to determinate if the system library has been updated.
int sl3::sqliteCompiledVersionNumber | ( | ) |
sqlite version number at compile time
if this library was linked against an installed version of sqlite this function can be used to determinate if the system library has been updated.
const char * sl3::sqliteRuntimeVersion | ( | ) |
sqlite version string at runtime
if this library was linked against an installed version of sqlite this function can be used to determinate if the system library has been updated.
int sl3::sqliteRuntimeVersionNumber | ( | ) |
sqlite version number at compile time
if this library was linked against an installed version of sqlite this function can be used to determinate if the system library has been updated.
int sl3::sqliteThreadSafeCompileOption | ( | ) |
returns value of SQLITE_THREADSAFE compilation option
see http://www.sqlite.org/compile.html about additional informations
DbValue specialized swap function.
a | first value to swap with second value |
b | second value to swap with first value |
This function call a.swap(b).
std::string sl3::typeName | ( | Type | ) |
Get the type name as string.
For example, in log messages a type "Real" is more verbose that a type 2.
equality, ignoring type info
Compares only the stored value and ignores type information.
a | first value to compare |
b | second value to compare |
less than, ignoring type info
Compares only the stored value and ignores type information.
a | first value to compare |
b | second value to compare |
equality, including type info
Check if 2 Value instances are of the same type and of the same value.
a | first element to compare |
b | second element to compare |
less than, including type info
Applies following rules which are equal to the sorting rules of sqlite.
Type::Text is less than Type::Blob
The comparison of the value itself is implemented via std::less.
a | first element to compare |
b | second element to compare |