Wt  4.11.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Wt::Dbo::backend::Firebird Class Reference

A Firebird connection. More...

#include <Wt/Dbo/backend/Firebird.h>

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

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 std::unique_ptr< SqlConnectionclone () const override
 Clones the connection.
 
IBPP::Database connection ()
 Returns the underlying connection handle.
 
virtual void startTransaction () override
 Starts a transaction.
 
virtual void commitTransaction () override
 Commits a transaction.
 
virtual void rollbackTransaction () override
 Rolls back a transaction.
 
virtual std::unique_ptr< SqlStatementprepareStatement (const std::string &sql) override
 Prepares a statement.
 
virtual void prepareForDropTables () override
 Execute code before dropping the tables.
 
Methods that return dialect information
virtual std::string autoincrementSql () const override
 Returns the 'autoincrement' SQL type modifier.
 
virtual std::vector< std::string > autoincrementCreateSequenceSql (const std::string &table, const std::string &id) const override
 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 override
 Returns the SQL statement(s) required to drop an id sequence.
 
virtual std::string autoincrementType () const override
 Returns the 'autoincrement' SQL type.
 
virtual std::string autoincrementInsertSuffix (const std::string &id) const override
 Returns the suffix for an 'autoincrement' insert statement.
 
virtual const chardateTimeType (SqlDateTimeType type) const override
 Returns the date/time type.
 
virtual const charblobType () const override
 Returns the blob type.
 
virtual std::string textType (int size) const override
 Returns the text type.
 
virtual const charbooleanType () const override
 Returns the boolean type.
 
virtual bool supportAlterTable () const override
 Returns true if the backend support Alter Table.
 
virtual bool usesRowsFromTo () const override
 Returns whether the SQL dialect uses 'ROWS ? TO ?', limit or rownum for partial select results.
 
- Public Member Functions inherited from Wt::Dbo::SqlConnection
virtual ~SqlConnection ()
 Destructor.
 
virtual void executeSql (const std::string &sql)
 Executes an SQL statement.
 
virtual void executeSqlStateful (const std::string &sql)
 Executes a connection-stateful SQL statement.
 
virtual SqlStatementgetStatement (const std::string &id) const
 Returns the statement with the given id.
 
virtual void saveStatement (const std::string &id, std::unique_ptr< SqlStatement > statement)
 Saves a statement with the given id.
 
void setProperty (const std::string &name, const std::string &value)
 Sets a property.
 
std::string property (const std::string &name) const
 Returns a property.
 
virtual std::string autoincrementInsertInfix (const std::string &id) const
 Returns the infix for an 'autoincrement' insert statement.
 
virtual std::string longLongType () const
 Returns the 64-bit integer type.
 
virtual bool supportUpdateCascade () const
 Returns true if the database supports Update Cascade.
 
virtual bool requireSubqueryAlias () const
 Returns the true if the database require subquery alias.
 
virtual bool supportDeferrableFKConstraint () const
 Returns true if the backend supports "deferrable initially deferred" foreign key constraints.
 
virtual const charalterTableConstraintString () const
 Returns the command used in alter table .. drop constraint ..
 

Detailed Description

A Firebird connection.

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

Warning
The Firebird backend is UNMAINTAINED, and may not work at all with recent versions of Firebird. This backend is based on IBPP, a project which has not seen any activity in a very long time. Emweb has no plans to continue supporting the Firebird backend.

Constructor & Destructor Documentation

◆ Firebird() [1/2]

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.

◆ Firebird() [2/2]

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

Copy constructor.

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

◆ ~Firebird()

Wt::Dbo::backend::Firebird::~Firebird ( )
virtual

Destructor.

Closes the connection.

Member Function Documentation

◆ autoincrementCreateSequenceSql()

std::vector< std::string > Wt::Dbo::backend::Firebird::autoincrementCreateSequenceSql ( const std::string &  table,
const std::string &  id 
) const
overridevirtual

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.

◆ autoincrementDropSequenceSql()

std::vector< std::string > Wt::Dbo::backend::Firebird::autoincrementDropSequenceSql ( const std::string &  table,
const std::string &  id 
) const
overridevirtual

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.

◆ autoincrementInsertSuffix()

std::string Wt::Dbo::backend::Firebird::autoincrementInsertSuffix ( const std::string &  id) const
overridevirtual

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.

◆ autoincrementSql()

std::string Wt::Dbo::backend::Firebird::autoincrementSql ( ) const
overridevirtual

Returns the 'autoincrement' SQL type modifier.

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

Implements Wt::Dbo::SqlConnection.

◆ autoincrementType()

std::string Wt::Dbo::backend::Firebird::autoincrementType ( ) const
overridevirtual

Returns the 'autoincrement' SQL type.

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

Implements Wt::Dbo::SqlConnection.

◆ blobType()

const char * Wt::Dbo::backend::Firebird::blobType ( ) const
overridevirtual

◆ booleanType()

const char * Wt::Dbo::backend::Firebird::booleanType ( ) const
overridevirtual

Returns the boolean type.

This method will return "boolean" by default.

Reimplemented from Wt::Dbo::SqlConnection.

◆ clone()

std::unique_ptr< SqlConnection > Wt::Dbo::backend::Firebird::clone ( ) const
overridevirtual

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.

◆ commitTransaction()

void Wt::Dbo::backend::Firebird::commitTransaction ( )
overridevirtual

Commits a transaction.

This function commits a transaction.

Implements Wt::Dbo::SqlConnection.

◆ connect()

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.

◆ dateTimeType()

const char * Wt::Dbo::backend::Firebird::dateTimeType ( SqlDateTimeType  type) const
overridevirtual

◆ prepareForDropTables()

void Wt::Dbo::backend::Firebird::prepareForDropTables ( )
overridevirtual

Execute code before dropping the tables.

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

Reimplemented from Wt::Dbo::SqlConnection.

◆ prepareStatement()

std::unique_ptr< SqlStatement > Wt::Dbo::backend::Firebird::prepareStatement ( const std::string &  sql)
overridevirtual

Prepares a statement.

Returns the prepared statement.

Implements Wt::Dbo::SqlConnection.

◆ rollbackTransaction()

void Wt::Dbo::backend::Firebird::rollbackTransaction ( )
overridevirtual

Rolls back a transaction.

This function rolls back a transaction.

Implements Wt::Dbo::SqlConnection.

◆ startTransaction()

void Wt::Dbo::backend::Firebird::startTransaction ( )
overridevirtual

Starts a transaction.

This function starts a transaction.

Implements Wt::Dbo::SqlConnection.

◆ supportAlterTable()

bool Wt::Dbo::backend::Firebird::supportAlterTable ( ) const
overridevirtual

Returns true if the backend support Alter Table.

This method will return false by default.

Reimplemented from Wt::Dbo::SqlConnection.

◆ textType()

std::string Wt::Dbo::backend::Firebird::textType ( int  size) const
overridevirtual

Returns the text type.

This is the text type for a string. If size = -1, then a type should be returned which does not require size information, otherwise a type should be returned that limits the size of the stored string to size.

This method will return "text" by default if size = -1, and "varchar(size)" otherwise.

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

Reimplemented from Wt::Dbo::SqlConnection.

◆ usesRowsFromTo()

virtual bool Wt::Dbo::backend::Firebird::usesRowsFromTo ( ) const
overridevirtual

Returns whether the SQL dialect uses 'ROWS ? TO ?', limit or rownum for partial select results.

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

The default implementation returns LimitQuery::Limit.

Reimplemented from Wt::Dbo::SqlConnection.