Harlinn.Windows 0.1
|
Manages the handle to an Extensible Storage Engine database, providing an API that exposes the operations that can be performed on the database. More...
#include <HCCEse.h>
Public Member Functions | |
constexpr | Database () noexcept |
Constructs a Database object that is not connected to an Extensible Storage Engine database. | |
Database (JET_SESID sessionId, JET_DBID databaseId) | |
Constructs a Database object that is connected to an Extensible Storage Engine database. | |
Database (const Database &other)=delete | |
Copy construction is not allowed. | |
Database (Database &&other) noexcept | |
Move constructor, taking ownership of the handles from the other database object. | |
~Database () | |
Database & | operator= (const Database &other)=delete |
Copy assignment is not allowed. | |
Database & | operator= (Database &&other) noexcept |
Move assignment implemented by swapping handles wit the argument database object. | |
JET_SESID | SessionHandle () const |
Returns the handle of the session that was used to open or create the database. | |
JET_DBID | Handle () const |
The raw database handle. | |
void | OnDatabaseCreated () |
void | OnDatabaseOpened () |
constexpr bool | IsValid () const noexcept |
A Database object where the session handle is not equal to JET_sesidNil and the database handle is not equal to JET_dbidNil is considered to be a valid Database object. | |
constexpr | operator bool () const noexcept |
A Database object where the session handle is not equal to JET_sesidNil and the database handle is not equal to JET_dbidNil is considered to be a valid Database object. | |
void | Close () |
Closes a database. | |
Result | OpenTable (const wchar_t *tablename, const void *parameters, unsigned long parametersSize, OpenTableFlags flags, JET_TABLEID *tableId) const |
Opens a cursor on a previously created table. | |
Result | OpenTable (const char *tablename, const void *parameters, unsigned long parametersSize, OpenTableFlags flags, JET_TABLEID *tableId) const |
Opens a cursor on a previously created table. | |
template<TableType T = Table, ApiCharType C> | |
T | OpenTable (const C *tableName, OpenTableFlags flags=OpenTableFlags::Updatable, bool noexception=false) const |
Opens a cursor on a previously created table. | |
template<TableType T = Table, SimpleStringLike S> | |
T | OpenTable (const S &tablename, OpenTableFlags flags=OpenTableFlags::Updatable, bool noexception=false) const |
Opens a cursor on a previously created table. | |
Result | CreateTable (const wchar_t *tablename, unsigned long initialNumberOfPages, unsigned long density, JET_TABLEID *tableId) const |
Result | CreateTable (const char *tablename, unsigned long initialNumberOfPages, unsigned long density, JET_TABLEID *tableId) const |
template<TableType T = Table, ApiCharType C> | |
T | CreateTable (const C *tablename, unsigned long initialNumberOfPages=1, unsigned long density=0) const |
Creates an empty table in the database. | |
template<TableType T = Table, SimpleStringLike S> | |
T | CreateTable (const S &tablename, unsigned long initialNumberOfPages=1, unsigned long density=0) const |
Creates an empty table in the database. | |
template<StringLike StringT = WideString> | |
Tables< StringT > | GetTables () const |
Retrieves an Tables<StringT> that can be used to enumerate the tables in the database. | |
void | DeleteTable (const wchar_t *tableName) |
Deletes a table in a database. | |
void | DeleteTable (const char *tableName) |
Deletes a table in a database. | |
template<SimpleStringLike T> | |
void | DeleteTable (const T &tableName) |
Deletes a table in a database. | |
ObjectInfo | GetTableInfo (const wchar_t *objectName) const |
Retrieves information about a table in the database. | |
ObjectInfo | GetTableInfo (const char *objectName) const |
Retrieves information about a table in the database. | |
template<SimpleStringLike S> | |
ObjectInfo | GetTableInfo (const S &objectName) const |
Retrieves information about a table in the database. | |
bool | TableExists (const wchar_t *objectName) const |
Test if a table exists in the database. | |
bool | TableExists (const char *objectName) const |
Test if a table exists in the database. | |
template<SimpleStringLike S> | |
bool | TableExists (const S &objectName) const |
Test if a table exists in the database. | |
Protected Member Functions | |
void | BeginTransaction () const |
void | CommitTransaction (TransactionFlags flags=TransactionFlags::None) const |
Private Attributes | |
JET_SESID | sessionId_ |
JET_DBID | databaseId_ |
Manages the handle to an Extensible Storage Engine database, providing an API that exposes the operations that can be performed on the database.
|
inlineconstexprnoexcept |
|
inline |
|
delete |
Copy construction is not allowed.
|
inlinenoexcept |
Move constructor, taking ownership of the handles from the other database object.
|
inline |
|
inlineprotected |
|
inline |
Closes a database.
|
inlineprotected |
|
inlinenodiscard |
Creates an empty table in the database.
tablename | The name of the table to create |
initialNumberOfPages | The initial number of database pages to allocate for the table. Specifying a number larger than one can reduce fragmentation if many rows are inserted into this table |
density | The table density, in percentage points. The number must be either 0 or in the range of 20 through 100. Passing 0 means that the default value should be used. The default is 80 |
|
inline |
|
inlinenodiscard |
Creates an empty table in the database.
tablename | The name of the table to create |
initialNumberOfPages | The initial number of database pages to allocate for the table. Specifying a number larger than one can reduce fragmentation if many rows are inserted into this table |
density | The table density, in percentage points. The number must be either 0 or in the range of 20 through 100. Passing 0 means that the default value should be used. The default is 80 |
|
inline |
|
inline |
Deletes a table in a database.
tableName | The name of the table to delete. |
|
inline |
Deletes a table in a database.
tableName | The name of the table to delete. |
|
inline |
Deletes a table in a database.
tableName | The name of the table to delete. |
|
inlinenodiscard |
Retrieves information about a table in the database.
objectName | The name of the table. |
|
inlinenodiscard |
Retrieves information about a table in the database.
objectName | The name of the table. |
|
inlinenodiscard |
Retrieves information about a table in the database.
objectName | The name of the table. |
|
inlinenodiscard |
Retrieves an Tables<StringT> that can be used to enumerate the tables in the database.
StringT |
|
inline |
The raw database handle.
|
inlineconstexprnoexcept |
|
inline |
|
inline |
|
inlinenodiscard |
Opens a cursor on a previously created table.
T | Ese::Table or a type derived from Ese::Table. |
C | char or wchar_t. |
tableName | The name of the table to open. |
flags | Zero or more values from the OpenTableFlags enumeration. The values can be combined using the | operator. |
noexception | If true this function will not throw an exception if table identified by tableName is not found in the database and return an invalid Table object. |
Derived classes should implement OnTableOpened( ) which is called just after constructing the Table, or Table derived object. This is an opportunity for Table derived objects to retrieve the column ids for the table.
|
inline |
Opens a cursor on a previously created table.
tablename | The name of the table to open. |
parameters | Deprecated. Set to nullptr. |
parametersSize | Deprecated. Set to 0. |
flags | Zero or more values from the OpenTableFlags enumeration. The values can be combined using the | operator. |
tableId | On success, points to the identifier of the table. On failure, the contents for tableId are undefined. |
|
inlinenodiscard |
Opens a cursor on a previously created table.
T | Ese::Table or a type derived from Ese::Table. |
C | char or wchar_t. |
tableName | The name of the table to open. |
flags | Zero or more values from the OpenTableFlags enumeration. The values can be combined using the | operator. |
noexception | If true this function will not throw an exception if table identified by tableName is not found in the database and return an invalid Table object. |
Derived classes should implement OnTableOpened( ) which is called just after constructing the Table, or Table derived object. This is an opportunity for Table derived objects to retrieve the column ids for the table. </ramarks>
|
inline |
Opens a cursor on a previously created table.
tablename | The name of the table to open. |
parameters | Deprecated. Set to nullptr. |
parametersSize | Deprecated. Set to 0. |
flags | Zero or more values from the OpenTableFlags enumeration. The values can be combined using the | operator. |
tableId | On success, points to the identifier of the table. On failure, the contents for tableId are undefined. |
|
inlineexplicitconstexprnoexcept |
Copy assignment is not allowed.
Move assignment implemented by swapping handles wit the argument database object.
|
inline |
Returns the handle of the session that was used to open or create the database.
|
inlinenodiscard |
Test if a table exists in the database.
objectName | The name of the table. |
|
inlinenodiscard |
Test if a table exists in the database.
objectName | The name of the table. |
|
inlinenodiscard |
Test if a table exists in the database.
objectName | The name of the table. |
|
private |
|
private |