Wt: Wt::Dbo::backend::Firebird Class Reference

Wt 3.3.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Hierarchy
- Class Members

Public Member Functions
Wt::Dbo::backend::Firebird Class Reference
Database Objects (Wt::Dbo)

A Firebird connection. More...

`#include <Wt/Dbo/backend/Firebird>`

Inheritance diagram for Wt::Dbo::backend::Firebird:
[legend]

List of all members.

## Public Member Functions
| Firebird ()
| Creates a Firebird backend connection.
| Firebird (const std::string &ServerName, const std::string &DatabaseName, const std::string &UserName, const std::string &UserPassword, const std::string &RoleName, const std::string &CharSet=std::string(), const std::string &CreateParams=std::string())
| Creates and opens a Firebird backend connection.
| Firebird (IBPP::Database db)
| Creates and opens a Firebird backend connection.
| Firebird (const Firebird &other)
| Copy constructor.
virtual | ~Firebird ()
| Destructor.
bool | connect (const std::string &ServerName, const std::string &DatabaseName, const std::string &UserName, const std::string &UserPassword, const std::string &RoleName, const std::string &CharSet=std::string(), const std::string &CreateParams=std::string())
| Tries to connect.
virtual Firebird * | clone () const
| Clones the connection.
IBPP::Database | connection ()
| Returns the underlying connection handle.
virtual void | startTransaction ()
| Starts a transaction.
virtual void | commitTransaction ()
| Commits a transaction.
virtual void | rollbackTransaction ()
| Rolls back a transaction.
virtual SqlStatement * | prepareStatement (const std::string &sql)
| Prepares a statement.
virtual void | prepareForDropTables ()
| Execute code before dropping the tables.
Methods that return dialect information
virtual std::string | autoincrementSql () const
| Returns the 'autoincrement' SQL type modifier.
virtual std::vector< std::string > | autoincrementCreateSequenceSql (const std::string &table, const std::string &id) const
| Returns the SQL statement(s) required to create an id sequence.
virtual std::vector< std::string > | autoincrementDropSequenceSql (const std::string &table, const std::string &id) const
| Returns the SQL statement(s) required to drop an id sequence.
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.
virtual const char * | textType () const
| Returns the text type.
virtual const char * | booleanType () const
| Returns the boolean type.
virtual bool | usesRowsFromTo () const
| Returns whether the SQL dialect uses 'ROWS ? TO ?' for partial select results.
virtual bool | supportAlterTable () const
| Returns true if the backend support Alter Table.

## Detailed Description

A Firebird connection.

This class provides the backend implementation for Firebird databases. It supports Firebird databases with version 2.1 or higher.

## Constructor & Destructor Documentation

Wt::Dbo::backend::Firebird::Firebird | ( |  | ) |

Creates a Firebird backend connection.

The connection is not yet open, and requires a connect() before it can be used.

Wt::Dbo::backend::Firebird::Firebird | ( | const Firebird & | other | ) |

Copy constructor.

This creates a new backend connection with the same settings as another connection.

Wt::Dbo::backend::Firebird::~Firebird | ( |  | ) | `[virtual]`

Destructor.

Closes the connection.

## Member Function Documentation

std::vector< std::string > Wt::Dbo::backend::Firebird::autoincrementCreateSequenceSql | ( | const std::string & | table,
|  | const std::string & | id
| ) |  | const`[virtual]`

Returns the SQL statement(s) required to create an id sequence.

This is used by Session::createTables() to create the id sequence for a table. The table's name and primary key are passed as arguments to this function and can be used to construct an SQL sequence that is unique for the table.

Implements Wt::Dbo::SqlConnection.

std::vector< std::string > Wt::Dbo::backend::Firebird::autoincrementDropSequenceSql | ( | const std::string & | table,
|  | const std::string & | id
| ) |  | const`[virtual]`

Returns the SQL statement(s) required to drop an id sequence.

This is used by Session::dropTables() to drop the id sequence for a table. The table's name and primary key are passed as arguments to this function and can be used to construct an SQL sequence that is unique for the table.

Implements Wt::Dbo::SqlConnection.

std::string Wt::Dbo::backend::Firebird::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::Firebird::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::Firebird::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::Firebird::blobType | ( |  | ) | const`[virtual]`

Returns the blob type.

See also:
  SqlStatement::bind(int, const std::vector<unsigned char>&)

Implements Wt::Dbo::SqlConnection.

const char * Wt::Dbo::backend::Firebird::booleanType | ( |  | ) | const`[virtual]`

Returns the boolean type.

This method will return "boolean" by default.

Reimplemented from Wt::Dbo::SqlConnection.

Firebird * Wt::Dbo::backend::Firebird::clone | ( |  | ) | const`[virtual]`

Clones the connection.

Returns a new connection object that is configured like this object. This is used by connection pool implementations to create its connections.

Implements Wt::Dbo::SqlConnection.

void Wt::Dbo::backend::Firebird::commitTransaction | ( |  | ) | `[virtual]`

Commits a transaction.

This function commits a transaction.

Implements Wt::Dbo::SqlConnection.

bool Wt::Dbo::backend::Firebird::connect | ( | const std::string & | ServerName,
|  | const std::string & | DatabaseName,
|  | const std::string & | UserName,
|  | const std::string & | UserPassword,
|  | const std::string & | RoleName,
|  | const std::string & | CharSet = `std::string()`,
|  | const std::string & | CreateParams = `std::string()`
| ) |  |

Tries to connect.

Throws an exception if there was a problem, otherwise returns `true`.

const char * Wt::Dbo::backend::Firebird::dateTimeType | ( | SqlDateTimeType | type | ) | const`[virtual]`

Returns the date/time type.

See also:
  SqlStatement::bind(int, const boost::posix_time::ptime&, SqlDateTimeType)

Implements Wt::Dbo::SqlConnection.

void Wt::Dbo::backend::Firebird::prepareForDropTables | ( |  | ) | `[virtual]`

Execute code before dropping the tables.

This method is called before calling Session::dropTables(). The default implementation is empty.

Reimplemented from Wt::Dbo::SqlConnection.

SqlStatement * Wt::Dbo::backend::Firebird::prepareStatement | ( | const std::string & | sql | ) | `[virtual]`

Prepares a statement.

Returns the prepared statement.

Implements Wt::Dbo::SqlConnection.

void Wt::Dbo::backend::Firebird::rollbackTransaction | ( |  | ) | `[virtual]`

Rolls back a transaction.

This function rolls back a transaction.

Implements Wt::Dbo::SqlConnection.

void Wt::Dbo::backend::Firebird::startTransaction | ( |  | ) | `[virtual]`

Starts a transaction.

This function starts a transaction.

Implements Wt::Dbo::SqlConnection.

bool Wt::Dbo::backend::Firebird::supportAlterTable | ( |  | ) | const`[virtual]`

Returns true if the backend support Alter Table.

This method will return false by default.

Reimplemented from Wt::Dbo::SqlConnection.

const char * Wt::Dbo::backend::Firebird::textType | ( |  | ) | const`[virtual]`

Returns the text type.

This method will return "text" by default.

See also:
  SqlStatement::bind(int column, const std::string& value)

Reimplemented from Wt::Dbo::SqlConnection.

bool Wt::Dbo::backend::Firebird::usesRowsFromTo | ( |  | ) | const`[virtual]`

Returns whether the SQL dialect uses 'ROWS ? TO ?' for partial select results.

This is an alternative SQL dialect option to the (non-standard) 'OFFSET ? LIMIT ?' syntax.

The default implementation returns `false`.

Reimplemented from Wt::Dbo::SqlConnection.

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator