#define DeclareString(NAME, FOURCC, ACCESSMODE)
Definition attributedefinition.h:94
#define DeclareBool(NAME, FOURCC, ACCESSMODE)
Definition attributedefinition.h:78
The common base class of Nebula.
Definition refcounted.h:38
Wraps an entire database into a C++ object.
Definition database.h:30
virtual void BeginTransaction()
begin a transaction on the database
Definition database.cc:82
virtual void AddTable(const Ptr< Table > &table)
create a new table in the database
Definition database.cc:107
const IO::URI & GetURI() const
get the database URI
Definition database.h:172
void SetURI(const IO::URI &uri)
set the data source URI (usually filename of database file)
Definition database.h:163
virtual void DeleteTable(const Util::String &tableName)
delete a table from the database
Definition database.cc:122
virtual void Close()
close the database
Definition database.cc:62
bool ignoreUnknownColumns
Definition database.h:105
IO::URI uri
Definition database.h:106
Util::String error
Definition database.h:107
bool GetExclusiveMode() const
get exclusive mode
Definition database.h:217
virtual void DetachDatabase(const Util::String &dbName)
detach an attached database
Definition database.cc:221
bool GetIgnoreUnknownColumns() const
get ignore unknown columns flag
Definition database.h:127
const Ptr< Table > & GetTableByIndex(IndexT i) const
get table by index
Definition database.cc:180
void SetError(const Util::String &error)
set error string
Definition database.h:136
IndexT FindTableIndex(const Util::String &tableName) const
find a table index by name
Definition database.cc:136
bool IsOpen() const
return true if database is open
Definition database.h:154
AccessMode GetAccessMode() const
get access mode
Definition database.h:190
virtual bool AttachDatabase(const IO::URI &uri, const Util::String &dbName)
attach another database to the current database
Definition database.cc:209
virtual void EndTransaction()
end a transaction on the database
Definition database.cc:92
bool HasTable(const Util::String &tableName) const
return true if a table exists by name
Definition database.cc:157
Util::Array< Ptr< Table > > tables
Definition database.h:111
AccessMode
access modes
Definition database.h:35
@ ReadWriteCreate
Definition database.h:38
@ ReadOnly
Definition database.h:36
@ ReadWriteExisting
Definition database.h:37
AccessMode accessMode
Definition database.h:108
Database()
constructor
Definition database.cc:25
SizeT GetNumTables() const
get number of tables in the database
Definition database.cc:168
void SetIgnoreUnknownColumns(bool b)
ignore unknown columns (not existing as attribute), yes/no
Definition database.h:118
bool isOpen
Definition database.h:104
bool exclusiveMode
Definition database.h:110
void SetAccessMode(AccessMode m)
set the access mode (ReadOnly or ReadWrite)
Definition database.h:181
virtual ~Database()
destructor
Definition database.cc:38
void SetExclusiveMode(bool b)
enable/disable exclusive mode
Definition database.h:208
bool memoryDatabase
Definition database.h:109
void SetInMemoryDatabase(bool b)
set in-memory database only
Definition database.h:199
virtual bool Open()
open the database
Definition database.cc:49
const Ptr< Table > & GetTableByName(const Util::String &tableName) const
get table by name
Definition database.cc:192
virtual void CopyInMemoryDatabaseToFile(const IO::URI &fileUri)
copy in memory database to file
Definition database.cc:232
const Util::String & GetError() const
get last error string
Definition database.h:145
An URI object can split a Uniform Resource Identifier string into its components or build a string fr...
Definition uri.h:67
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
Definition accessmode.h:13
@ ReadWrite
Definition accessmode.h:17
Nebula's universal string class.
Definition string.h:50
int SizeT
Definition types.h:49
int IndexT
Definition types.h:48