A ObjectBox store represents a database storing data in a given directory on a local file system.
More...
|
| Store (OBX_model *model) |
| Creates a Store with the given model and default Options. More...
|
|
| Store (Options &options) |
| Creates a Store with the given Options, which also contain the data model. More...
|
|
| Store (Options &&options) |
| Creates a Store with the given Options, which also contain the data model. More...
|
|
| Store (OBX_store *cStore) |
| Wraps an existing C-API store pointer, taking ownership (don't close it manually anymore) More...
|
|
| Store (const Store &)=delete |
| Can't be copied, single owner of C resources is required (to avoid double-free during destruction) More...
|
|
| Store (Store &&source) noexcept |
|
virtual | ~Store () |
|
OBX_store * | cPtr () const |
|
uint64_t | id () const |
|
uint32_t | getStoreTypeId () |
| Get Store type. More...
|
|
uint64_t | getDbSize () const |
| Get the size of the store. For a disk-based store type, this corresponds to the size on disk, and for the in-memory store type, this is roughly the used memory bytes occupied by the data. More...
|
|
uint64_t | getDbSizeOnDisk () const |
| The size in bytes occupied by the database on disk (if any). More...
|
|
template<class EntityBinding > |
Box< EntityBinding > | box () |
|
Transaction | tx (TxMode mode) |
| Starts a transaction using the given mode. More...
|
|
Transaction | txRead () |
| Starts a read(-only) transaction. More...
|
|
Transaction | txWrite () |
| Starts a (read &) write transaction. More...
|
|
obx_schema_id | getEntityTypeIdNoThrow (const char *entityName) const |
| Does not throw if the given type name is not found (it may still throw in other conditions). More...
|
|
obx_schema_id | getEntityTypeId (const char *entityName) const |
|
obx_schema_id | getPropertyIdNoThrow (obx_schema_id entityId, const char *propertyName) const |
| Does not throw if the given property name is not found (it may still throw in other conditions). More...
|
|
obx_schema_id | getPropertyId (obx_schema_id entityId, const char *propertyName) const |
|
obx_schema_id | getPropertyId (const char *entityName, const char *propertyName) const |
|
BoxTypeless | boxTypeless (const char *entityName) |
|
bool | awaitCompletion () |
| Await all (including future) async submissions to be completed (the async queue becomes empty). More...
|
|
bool | awaitSubmitted () |
| Await previously submitted async operations to be completed (the async queue may still contain elements). More...
|
|
void | backUpToFile (const char *backupFile, uint32_t flags=0) const |
| Backs up the store DB to the given backup-file, using the given flags. Note: backup is a server-only feature. More...
|
|
std::shared_ptr< SyncClient > | syncClient () |
|
void | prepareToClose () |
| Prepares the store to close by setting its internal state to "closing". Methods like tx() an boxFor() will throw ShuttingDownException once closing is initiated. Unlike close(), this method will return immediately and does not free resources just yet. This is typically used in a multi-threaded context to allow an orderly shutdown in stages which go through a "not accepting new requests" state. More...
|
|
void | close () |
| Closes all resources of this store before the destructor is called, e.g. to avoid waiting in the destructor. Avoid calling methods on the Store after this call; most methods will throw ShuttingDownException in that case. Calling close() more than once have no effect, and concurrent calls to close() are fine too. More...
|
|
|
static const char * | versionCString () |
| Return the (runtime) version of the library to be printed. The current format is "major.minor.patch" (e.g. "1.0.0") but may change in any future release. Thus, only use for information purposes. More...
|
|
static std::string | versionString () |
| Creates a new string containing versionCString() More...
|
|
static const char * | versionCoreCString () |
| Return the version of the ObjectBox core to be printed (currently also contains a version date and features). The format may change in any future release; only use for information purposes. More...
|
|
static std::string | versionCoreString () |
| Creates a new string containing versionCoreCString() More...
|
|
static void | getVersion (int *major, int *minor, int *patch) |
| Return the version of the library as ints. Pointers may be null. More...
|
|
static void | debugLog (bool enabled) |
| Enable (or disable) debug logging for ObjectBox internals. This requires a version of the library with the DebugLog feature. You can check if the feature is available with obx_has_feature(OBXFeature_DebugLog). More...
|
|
static bool | debugLogEnabled () |
| Checks if debug logs are enabled for ObjectBox internals. This depends on the availability of the DebugLog feature. If the feature is available, it returns the current state, which is adjustable via obx_debug_log(). Otherwise, it always returns false for standard release builds (or true if you are having a special debug version). More...
|
|
static void | removeDbFiles (const std::string &directory) |
| Delete the store files from the given directory. More...
|
|
static size_t | getDbFileSize (const std::string &directory) |
|
A ObjectBox store represents a database storing data in a given directory on a local file system.
Once opened using one of the constructors, Store is an entry point to data access APIs such as Box, Query, and Transaction.
It's possible open multiple stores in different directories, e.g. at the same time.