sqlitepp
A small sqlite3 C++ library
 All Classes Functions Pages
Public Member Functions | Friends | List of all members
sqlitepp::Database Class Reference

The main database class. More...

#include <sqlitepp.h>

Public Member Functions

 Database (void)
 empty constructor. Does not open a database
 
 Database (const std::string &path, const OpenFlags flag=CREATE)
 Opens a sqlite3 database with the passed flag. More...
 
 ~Database (void)
 destructor
 
void open (const std::string &path, const OpenFlags flag=CREATE)
 Opens a database with the passed flag. More...
 
bool isOpen (void)
 returns true, when a database has been opened, false otherwise
 
void close (void)
 closes the database
 
void activateForeignKeys (void)
 activates foreign keys
 
void deactivateForeignKeys (void)
 deactivates foreign keys
 
int exec (const std::string &sql)
 executes a single statement without return values More...
 
void beginTransaction (const TransactionFlags=DEFERRED)
 Begins a transaction.
 
void endTransaction (void)
 commits a transaction
 
void rollback (void)
 executes a rollback on the current transaction
 
int getLastRowId (void)
 gets the last ID, that has been inserted More...
 

Friends

class Statement
 

Detailed Description

The main database class.

Definition at line 73 of file sqlitepp.h.

Constructor & Destructor Documentation

sqlitepp::Database::Database ( const std::string &  path,
const OpenFlags  flag = CREATE 
)

Opens a sqlite3 database with the passed flag.

Parameters
path
flag

Definition at line 38 of file database.cpp.

Member Function Documentation

int sqlitepp::Database::exec ( const std::string &  sql)

executes a single statement without return values

Parameters
sqlSQL statement

Definition at line 98 of file database.cpp.

int sqlitepp::Database::getLastRowId ( void  )

gets the last ID, that has been inserted

Returns

Definition at line 32 of file database.cpp.

void sqlitepp::Database::open ( const std::string &  path,
const OpenFlags  flag = CREATE 
)

Opens a database with the passed flag.

Parameters
path
flag

Definition at line 53 of file database.cpp.


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