65 virtual void CommitChanges(
bool resetModifiedState=
true,
bool useTransaction=
true);
106 virtual void Disconnect(
bool dropTable=
false);
An attribute ID is used to carry attribute types (no values) around.
Definition attrid.h:20
The common base class of Nebula.
Definition refcounted.h:38
Describes a column in a database table.
Definition column.h:23
Wraps an entire database into a C++ object.
Definition database.h:30
A dataset is an efficient in-memory-cache for rlational database data.
Definition dataset.h:43
Describes a table in a database, or more abstract, a set of typed columns grouped under a common name...
Definition table.h:34
bool IsConnected() const
return true if the table is connected to a database
Definition table.h:159
const Util::String & GetName() const
get name of table
Definition table.h:169
virtual void Connect(const Ptr< Database > &db, ConnectMode connectMode=Default, bool ignoreUnknownColumns=false)
connect the table object with a database
Definition table.cc:92
virtual void CreateMultiColumnIndex(const Util::Array< Attr::AttrId > &columnIds)
create a complex multicolumn index on a connected table
Definition table.cc:122
const Column & GetColumn(IndexT i) const
get column at index
Definition table.h:189
virtual Ptr< Dataset > CreateDataset()
create a dataset associated with this table
Definition table.cc:44
Util::Dictionary< Attr::AttrId, IndexT > attrIdIndexMap
Definition table.h:119
bool HasUncommittedColumns() const
check if there are any uncommitted columns in the table
Definition table.cc:174
virtual ~Table()
destructor
Definition table.cc:31
bool isConnected
Definition table.h:112
bool HasPrimaryColumn() const
return true if a primary key column exists
Definition table.h:138
virtual void BindValueTable(const Ptr< ValueTable > &valueTable)
bind a value table to the table object, unbinds previous table
Definition table.cc:148
const Ptr< Database > & GetDatabase() const
get pointer to database this table is connected to
Definition table.h:128
Ptr< ValueTable > valueTable
Definition table.h:114
SizeT GetNumColumns() const
get number of columns in table
Definition table.h:179
IndexT primaryColumnIndex
Definition table.h:120
virtual void CommitChanges(bool resetModifiedState=true, bool useTransaction=true)
commit any changes (add columns, insert new rows, update modified rows)
Definition table.cc:135
bool HasColumn(const Attr::AttrId &id) const
return true if a column exists by attribute id
Definition table.h:199
Util::HashTable< Util::String, IndexT > nameIndexMap
Definition table.h:117
Util::Dictionary< Util::FourCC, IndexT > fourccIndexMap
Definition table.h:118
Util::String name
Definition table.h:115
ConnectMode
connection modes
Definition table.h:39
@ Default
Definition table.h:42
@ ForceCreate
Definition table.h:40
@ AssumeExists
Definition table.h:41
virtual void CommitDeletedRows()
commit deleted rows only
Definition table.cc:204
const Util::Array< Column > & GetColumns() const
get all columns in the table
Definition table.h:262
Ptr< Database > database
Definition table.h:113
virtual void Disconnect(bool dropTable=false)
disconnect the table from a database, optionally remove table from database as well
Definition table.cc:109
void AddColumn(const Column &c)
add a column to the table
Definition table.cc:57
virtual void CommitUncommittedColumns()
commit uncommitted columns only
Definition table.cc:194
virtual void UnbindValueTable()
unbind current value table from the table object, commits any changes to the database
Definition table.cc:161
virtual void SetName(const Util::String &n)
set name of table
Definition table.cc:75
Util::Array< Column > columns
Definition table.h:116
Table()
constructor
Definition table.cc:21
const Column & GetPrimaryColumn() const
get the primary key column, fails hard if none exists
Definition table.h:148
A wrapper class to bulk-write data to the database in a simple way.
Definition writer.h:23
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
Nebula's dynamic array class.
Definition array.h:60
A collection of key/value pairs with quick value retrieval by key at roughly O(log n).
Definition dictionary.h:34
bool Contains(const KEYTYPE &key) const
return true if key exists in the array
Definition dictionary.h:368
A four-character-code is a quasi-human-readable 32-bit-id.
Definition fourcc.h:19
Organizes key/value pairs by a hash code.
Definition hashtable.h:42
bool Contains(const KEYTYPE &key) const
return true if key exists in the array
Definition hashtable.h:552
#define n_assert(exp)
Definition debug.h:50
Nebula's universal string class.
Definition string.h:50
static const int InvalidIndex
Definition types.h:54
int SizeT
Definition types.h:49
int IndexT
Definition types.h:48