2005/5/9

     
 

class LiteDb

artefaktur
Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Namespace Members   Compound Members   Related Pages  

acdk::sql::sqlite::LiteDb Class Reference

#include <LiteTable.h>

Inheritance diagram for acdk::sql::sqlite::LiteDb:

acdk::lang::Object acdk::lang::ObjectBase acdk::lang::dmi::StdDispatch List of all members.

Detailed Description

thin wrapper to the SQLite3 database


Public Member Functions

 LiteDb (sqlite3 *con)
bool isClosed ()
void closeDb ()
RLiteMemTable execDirect (IN(RString) sql)
 execute a sql command on a LiteDB The complete result set will be hold in memory

void execute (IN(RString) sql)
 executes a SQL command

void execute (IN(RString) sql, IN(acdk::lang::dmi::RDmiDelegate) delegate)
 executes a SQL command an calles the delegate for each record set The arguments passed to the delegate are: - LiteDb __db - all fields as String of one record.

int executeUpdate (IN(RString) cmd)
 execute update, return the number of changes

RLiteTable prepareStatement (IN(RString) sql)
 creates a prepared statement

void createSqlFunction (IN(RString) function, int args, IN(acdk::lang::dmi::RDmiDelegate) delegate)
 this creates a function can be used inside an SQL Statement.

int checkResult (int result)
 internal helper to check calls to the C api

void checkLastResult ()
 only call this if a prior call failed

sqlite3 * getConPtr ()
int changes ()
 sqlite3_changes

void _checkOpenDb ()
 internal helper


Static Public Member Functions

RLiteDb openDb (IN(RString) fileName)
int checkResult (sqlite3 *con, int result)
 internal helper to check calls to the C api

void checkLastResult (sqlite3 *con)
 internal helper to check calls to the C api

RString getVersion ()
 return the version string of the sqlite3 c library


Protected Attributes

sqlite3 * _con


Constructor & Destructor Documentation

acdk::sql::sqlite::LiteDb::LiteDb sqlite3 *  con  ) 
 


Member Function Documentation

void acdk::sql::sqlite::LiteDb::_checkOpenDb  ) 
 

internal helper

int acdk::sql::sqlite::LiteDb::changes  ) 
 

sqlite3_changes

void acdk::sql::sqlite::LiteDb::checkLastResult sqlite3 *  con  )  [static]
 

internal helper to check calls to the C api

void acdk::sql::sqlite::LiteDb::checkLastResult  )  [inline]
 

only call this if a prior call failed

int acdk::sql::sqlite::LiteDb::checkResult sqlite3 *  con,
int  result
[static]
 

internal helper to check calls to the C api

int acdk::sql::sqlite::LiteDb::checkResult int  result  )  [inline]
 

internal helper to check calls to the C api

void acdk::sql::sqlite::LiteDb::closeDb  ) 
 

void acdk::sql::sqlite::LiteDb::createSqlFunction IN(RString function,
int  args,
IN(acdk::lang::dmi::RDmiDelegate delegate
 

this creates a function can be used inside an SQL Statement.

It is similar to stored procedure, but the function itself is not stored within the database, but provided by the application

RLiteMemTable acdk::sql::sqlite::LiteDb::execDirect IN(RString sql  ) 
 

execute a sql command on a LiteDB The complete result set will be hold in memory

void acdk::sql::sqlite::LiteDb::execute IN(RString sql,
IN(acdk::lang::dmi::RDmiDelegate delegate
 

executes a SQL command an calles the delegate for each record set The arguments passed to the delegate are: - LiteDb __db - all fields as String of one record.

  • The delete should return an int. if the return value is != 0 no more records will be fetched. See also samples in  acdk_sql_sqlite.

void acdk::sql::sqlite::LiteDb::execute IN(RString sql  ) 
 

executes a SQL command

int acdk::sql::sqlite::LiteDb::executeUpdate IN(RString cmd  ) 
 

execute update, return the number of changes

sqlite3* acdk::sql::sqlite::LiteDb::getConPtr  )  [inline]
 

RString acdk::sql::sqlite::LiteDb::getVersion  )  [static]
 

return the version string of the sqlite3 c library

bool acdk::sql::sqlite::LiteDb::isClosed  )  [inline]
 

RLiteDb acdk::sql::sqlite::LiteDb::openDb IN(RString fileName  )  [static]
 

RLiteTable acdk::sql::sqlite::LiteDb::prepareStatement IN(RString sql  ) 
 

creates a prepared statement


Member Data Documentation

sqlite3* acdk::sql::sqlite::LiteDb::_con [protected]