Public Types | Public Member Functions

Wt::Dbo::backend::Sqlite3 Class Reference
[Database Objects library (Dbo)]

An SQLite3 connection. More...

#include <Wt/Dbo/backend/Sqlite3>

Inherits Wt::Dbo::SqlConnection.

List of all members.

Public Types

enum  DateTimeStorage { ISO8601AsText, JulianDaysAsReal, UnixTimeAsInteger }
 

Configuration of date time storage.

More...

Public Member Functions

 Sqlite3 (const std::string &db)
 Opens a new SQLite3 backend connection.
 ~Sqlite3 ()
 Destructor.
sqlite3 * connection ()
 Returns the underlying connection.
void setDateTimeStorage (SqlDateTimeType type, DateTimeStorage format)
 Configures how to store date or date time.
DateTimeStorage dateTimeStorage (SqlDateTimeType type) const
 Returns the date time storage.
virtual void startTransaction ()
 Starts a transaction.
virtual void commitTransaction ()
 Commits a transaction.
virtual void rollbackTransaction ()
 Rolls back a transaction.
virtual SqlStatementprepareStatement (const std::string &sql)
 Prepares a statement.
Methods that return dialect information

virtual std::string autoincrementSql () const
 Returns the 'autoincrement' SQL type modifier.
virtual std::string autoincrementType () const
 Returns the 'autoincrement' SQL type.
virtual std::string autoincrementInsertSuffix () const
 Returns the suffix for an 'autoincrement' insert statement.
virtual const char * dateTimeType (SqlDateTimeType type) const
 Returns the date/time type.
virtual const char * blobType () const
 Returns the blob type.

Detailed Description

An SQLite3 connection.

This class provides the backend implementation for SQLite3 databases.


Member Enumeration Documentation

Configuration of date time storage.

SQlite3 does not provide real type support for date time. Instead, it offers 3 choices for storing a date time, each of these compatible with the use of the built-in arithmetic functions.

Enumerator:
ISO8601AsText 

As 'text' in ISO8601 format.

JulianDaysAsReal 

As 'real', the number of julian days. Note that this does not support second accuracy for a date time, but is the preferred format for a plain date.

UnixTimeAsInteger 

As 'integer', number of seconds since UNIX Epoch.


Constructor & Destructor Documentation

Wt::Dbo::backend::Sqlite3::Sqlite3 ( const std::string &  db  ) 

Opens a new SQLite3 backend connection.

The db may be any of the values supported by sqlite3_open().

Wt::Dbo::backend::Sqlite3::~Sqlite3 (  ) 

Destructor.

Closes the connection.


Member Function Documentation

std::string Wt::Dbo::backend::Sqlite3::autoincrementInsertSuffix (  )  const [virtual]

Returns the suffix for an 'autoincrement' insert statement.

This is appended to the insert statement, since some back-ends need to be indicated that they should return the autoincrement id.

Implements Wt::Dbo::SqlConnection.

std::string Wt::Dbo::backend::Sqlite3::autoincrementSql (  )  const [virtual]

Returns the 'autoincrement' SQL type modifier.

This is used by Session::createTables() to create the id column.

Implements Wt::Dbo::SqlConnection.

std::string Wt::Dbo::backend::Sqlite3::autoincrementType (  )  const [virtual]

Returns the 'autoincrement' SQL type.

This is used by Session::createTables() to create the id column.

Implements Wt::Dbo::SqlConnection.

const char * Wt::Dbo::backend::Sqlite3::blobType (  )  const [virtual]
void Wt::Dbo::backend::Sqlite3::commitTransaction (  )  [virtual]

Commits a transaction.

This function commits a transaction.

Implements Wt::Dbo::SqlConnection.

const char * Wt::Dbo::backend::Sqlite3::dateTimeType ( SqlDateTimeType  type  )  const [virtual]
SqlStatement * Wt::Dbo::backend::Sqlite3::prepareStatement ( const std::string &  sql  )  [virtual]

Prepares a statement.

Returns the prepared statement.

Implements Wt::Dbo::SqlConnection.

void Wt::Dbo::backend::Sqlite3::rollbackTransaction (  )  [virtual]

Rolls back a transaction.

This function rolls back a transaction.

Implements Wt::Dbo::SqlConnection.

void Wt::Dbo::backend::Sqlite3::setDateTimeStorage ( SqlDateTimeType  type,
DateTimeStorage  format 
)

Configures how to store date or date time.

The default format is ISO8601AsText.

void Wt::Dbo::backend::Sqlite3::startTransaction (  )  [virtual]

Starts a transaction.

This function starts a transaction.

Implements Wt::Dbo::SqlConnection.


Generated on Mon Nov 29 2010 08:03:20 for Wt by doxygen 1.7.1