clang-tags
C/C++ source code indexing tool based on libclang
 All Classes Functions Variables Typedefs Groups Pages
Classes | Public Member Functions | Friends | List of all members
Sqlite::Database Class Reference

Connection to an SQLite database. More...

#include <database.hxx>

Classes

struct  Sqlite3_

Public Member Functions

 Database (const std::string &fileName)
 Constructor.
int execute (char const *const sql)
 Execute a set of SQL statements.
Statement prepare (char const *const sql)
 Prepare execution of SQL statements.
const char * errMsg ()
 Retrieve the last SQLite error message.
int lastInsertRowId ()
 Retrieve the id of the last inserted row.

Friends

class Statement

Detailed Description

Connection to an SQLite database.

Constructor & Destructor Documentation

Sqlite::Database::Database ( const std::string &  fileName)
inline

Constructor.

Create a connection to the SQLite database stored in a given file.

Parameters
fileNamepath to the SQLite database file
Exceptions
Error

Member Function Documentation

const char* Sqlite::Database::errMsg ( )
inline

Retrieve the last SQLite error message.

Returns
a C-style string containing the error message
int Sqlite::Database::execute ( char const *const  sql)

Execute a set of SQL statements.

Parameters
sqlC-style string containing SQL statements
Returns
SQLITE_OK if everything went well
Exceptions
Error
int Sqlite::Database::lastInsertRowId ( )
inline

Retrieve the id of the last inserted row.

Returns
the row id, as an int
Statement Sqlite::Database::prepare ( char const *const  sql)

Prepare execution of SQL statements.

Get a prepared Statement object, which can then be executed with bound values.

Parameters
sqlC-style string containing SQL statements
Returns
a prepared Statement object for the SQL code

The documentation for this class was generated from the following files: