Wt
4.10.3
|
An SQLite3 connection. More...
#include <Wt/Dbo/backend/Sqlite3.h>
Public Member Functions | |
Sqlite3 (const std::string &db) | |
Opens a new SQLite3 backend connection. | |
Sqlite3 (const Sqlite3 &other) | |
Copies an SQLite3 connection. | |
~Sqlite3 () | |
Destructor. | |
virtual std::unique_ptr< SqlConnection > | clone () const override |
Clones the connection. | |
sqlite3 * | connection () |
Returns the underlying connection. | |
std::string | connectionString () |
Returns the underlying connection string. | |
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 () override |
Starts a transaction. | |
virtual void | commitTransaction () override |
Commits a transaction. | |
virtual void | rollbackTransaction () override |
Rolls back a transaction. | |
virtual std::unique_ptr< SqlStatement > | prepareStatement (const std::string &sql) override |
Prepares a statement. | |
![]() | |
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 SqlStatement * | getStatement (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 void | prepareForDropTables () |
Execute code before dropping the tables. | |
virtual std::string | textType (int size) const |
Returns the text type. | |
virtual std::string | longLongType () const |
Returns the 64-bit integer type. | |
virtual const char * | booleanType () const |
Returns the boolean 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 | usesRowsFromTo () const |
Returns whether the SQL dialect uses 'ROWS ? TO ?', limit or rownum for partial select results. | |
virtual bool | supportAlterTable () const |
Returns true if the backend support Alter Table. | |
virtual const char * | alterTableConstraintString () const |
Returns the command used in alter table .. drop constraint .. | |
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 char * | dateTimeType (SqlDateTimeType type) const override |
Returns the date/time type. | |
virtual const char * | blobType () const override |
Returns the blob type. | |
virtual bool | supportDeferrableFKConstraint () const override |
Returns true if the backend supports "deferrable initially
deferred" foreign key constraints. | |
An SQLite3 connection.
This class provides the backend implementation for SQLite3 databases.
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.
|
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.
|
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.
|
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.
|
overridevirtual |
Returns the 'autoincrement' SQL type modifier.
This is used by Session::createTables() to create the id column.
Implements Wt::Dbo::SqlConnection.
|
overridevirtual |
Returns the 'autoincrement' SQL type.
This is used by Session::createTables() to create the id column.
Implements Wt::Dbo::SqlConnection.
Returns the blob type.
Implements Wt::Dbo::SqlConnection.
|
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.
|
overridevirtual |
Returns the date/time type.
Implements Wt::Dbo::SqlConnection.
|
overridevirtual |
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.
Returns true if the backend supports "deferrable initially deferred" foreign key constraints.
This method will return false by default.
Reimplemented from Wt::Dbo::SqlConnection.