|
| Sqlite3Table () |
| constructor
|
|
virtual | ~Sqlite3Table () |
| destructor
|
|
virtual void | Connect (const Ptr< Database > &db, ConnectMode connectMode, bool ignoreUnknownColumn) |
| connect the table object with a database
|
|
virtual void | Disconnect (bool dropTable) |
| disconnect the table from a database
|
|
virtual void | CreateMultiColumnIndex (const Util::Array< Attr::AttrId > &columnIds) |
| This method creates a multicolumn index on the table.
|
|
virtual void | BindValueTable (const Ptr< ValueTable > &valueTable) |
| bind a value table to the table object, unbinds previous table
|
|
virtual void | UnbindValueTable () |
| unbind current value table from the table object, commits any changes to the database
|
|
virtual void | SetName (const Util::String &n) |
| set name of table
|
|
virtual void | CommitChanges (bool resetModifiedState, bool useTransaction) |
| commit any changes
|
|
virtual void | CommitUncommittedColumns () |
| commit uncommitted columns only
|
|
virtual void | CommitDeletedRows () |
| commit deleted rows only
|
|
| Table () |
| constructor
|
|
virtual | ~Table () |
| destructor
|
|
const Util::String & | GetName () const |
| get name of table
|
|
bool | IsConnected () const |
| return true if the table is connected to a database
|
|
const Ptr< Database > & | GetDatabase () const |
| get pointer to database this table is connected to
|
|
virtual Ptr< Dataset > | CreateDataset () |
| create a dataset associated with this table
|
|
bool | HasUncommittedColumns () const |
| check if there are any uncommitted columns in the table
|
|
void | AddColumn (const Column &c) |
| add a column to the table
|
|
SizeT | GetNumColumns () const |
| get number of columns in table
|
|
const Column & | GetColumn (IndexT i) const |
| get column at index
|
|
bool | HasColumn (const Attr::AttrId &id) const |
| return true if a column exists by attribute id
|
|
bool | HasColumn (const Util::String &name) const |
| return true if a column exists by name
|
|
bool | HasColumn (const Util::FourCC &fcc) const |
| return true if a column exists by fourCC
|
|
const Column & | GetColumn (const Attr::AttrId &id) const |
| get a column by attribute id
|
|
const Column & | GetColumn (const Util::String &name) const |
| get a column by name
|
|
const Column & | GetColumn (const Util::FourCC &fcc) const |
| get a column by fourCC
|
|
const Util::Array< Column > & | GetColumns () const |
| get all columns in the table
|
|
bool | HasPrimaryColumn () const |
| return true if a primary key column exists
|
|
const Column & | GetPrimaryColumn () const |
| get the primary key column, fails hard if none exists
|
|
| RefCounted () |
| constructor
|
|
int | GetRefCount () const |
| get the current refcount
|
|
void | AddRef () |
| increment refcount by one
|
|
void | Release () |
| decrement refcount and destroy object if refcount is zero
|
|
bool | IsInstanceOf (const Rtti &rtti) const |
| return true if this object is instance of given class
|
|
bool | IsInstanceOf (const Util::String &className) const |
| return true if this object is instance of given class by string
|
|
bool | IsInstanceOf (const Util::FourCC &classFourCC) const |
| return true if this object is instance of given class by fourcc
|
|
bool | IsA (const Rtti &rtti) const |
| return true if this object is instance of given class, or a derived class
|
|
bool | IsA (const Util::String &rttiName) const |
| return true if this object is instance of given class, or a derived class, by string
|
|
bool | IsA (const Util::FourCC &rttiFourCC) const |
| return true if this object is instance of given class, or a derived class, by fourcc
|
|
const Util::String & | GetClassName () const |
| get the class name
|
|
Util::FourCC | GetClassFourCC () const |
| get the class FourCC code
|
|
void Db::Sqlite3Table::CommitChanges |
( |
bool | resetModifiedState, |
|
|
bool | useTransaction ) |
|
virtual |
commit any changes
This writes any uncommited changes to the table layout back into the database.
NOTE: it is not possible to make an existing column primary, or to create an index for an existing column, this must happen when the table is actually created! This method also does not deletion of columns (SQLite doesn't support column removal, so what...).
Reimplemented from Db::Table.
void Db::Sqlite3Table::Connect |
( |
const Ptr< Database > & | db, |
|
|
ConnectMode | connectMode, |
|
|
bool | ignoreUnknownColumns ) |
|
virtual |
connect the table object with a database
This connects the table object with a database, from that moment on, all changes to the table object will be synchronized with the database.
Changes will be batched until CommitChanges() is called.
The following stuff happens at Connect() depending on the ConnectMode:
- ConnectMode=ForceCreate: a new empty table will be created in the database, if a table of the same name exists, it will be deleted first
- ConnectMode=AssumeExists: it is assumed that the table exists, the columns in the database will be checked against any columns in the table object and the Committed flag will be set on existing columns
- ConnectMode=Default: it is checked first if the table exists, if not it will be acted like ForceCreate, otherwise it will be acted like AssumeExists
Reimplemented from Db::Table.
void Db::Sqlite3Table::Disconnect |
( |
bool | dropTable | ) |
|
|
virtual |
disconnect the table from a database
This disconnects the table from the database.
If the dropTable argument is true (default is false), the actual database table will be deleted as well. Otherwise, a CommitChanges is invoked to write any local changes back into the database, and just the C++ table object is disconnected.
Reimplemented from Db::Table.
void Db::Sqlite3Table::ReadTableLayout |
( |
bool | ignoreUnknownColumns | ) |
|
|
private |
read the database table columns
This synchronizes this table object with the database table on a column-by-column basis.
If this table has columns which don't exist in the database, they will be added to the database table (however, this actually happens any time later during CommitChanges(). If this object is missing any columns from the db, they will be created on the table object. This method cannot be used to delete any columns from the database (in fact, deleting columns is also impossible in Sqlite).