objectbox.g library

Classes

Admin
ObjectBox Admin allows you to explore the database in a regular web browser.
Backlink annotation specifies a link in a reverse direction of another relation.
Box<T>
A Box instance gives you access to objects of a particular type. You get Box instances via Store.box() or Box(Store).
CacheEntity_
CacheEntity entity fields to define ObjectBox queries.
Condition<EntityT>
A Query condition base class.
DebugFlags
Passed as debugFlags when calling Store.new to enable debug options.
Entity
Entity annotation is used on a class to let ObjectBox know it should store it - making the class a "persistable Entity".
Id
Annotation Id can be used to specify an entity ID property if it's named anything else then "id" (case insensitive).
Index
Specifies that the property should be indexed.
Order
Groups query order flags.
Property
Use to (optionally) annotate a field to explicitly configure some details about how a field is stored in the database.
PropertyQuery<T>
Property query base.
Query<T>
A repeatable Query returning the latest matching Objects.
QueryBacklinkToMany<Source, Target>
QueryBooleanProperty<EntityT>
QueryBuilder<T>
Query builder allows creating reusable queries.
QueryByteVectorProperty<EntityT>
QueryDateNanoProperty<EntityT>
This wraps QueryIntegerProperty for DateTime properties annotated with @Property(type: PropertyType.dateNano) to avoid having to manually convert to nanoseconds (DateTime.microsecondsSinceEpoch * 1000) when creating query conditions.
QueryDateProperty<EntityT>
This wraps QueryIntegerProperty for DateTime properties to avoid having to manually convert to DateTime.millisecondsSinceEpoch when creating query conditions.
QueryDoubleProperty<EntityT>
QueryDoubleVectorProperty<EntityT>
For double vectors greater and less queries are supported on elements of the vector (e.g. "has element greater").
QueryIntegerProperty<EntityT>
QueryIntegerVectorProperty<EntityT>
For integer vectors (excluding QueryByteVectorProperty) greater, less and equal are supported on elements of the vector (e.g. "has element greater").
QueryProperty<EntityT, DartType>
The QueryProperty types allow users to build query conditions on a property.
QueryRelationToMany<Source, Target>
QueryRelationToOne<Source, Target>
QueryStringProperty<EntityT>
QueryStringVectorProperty<EntityT>
Store
Represents an ObjectBox database and works together with Box to allow getting and putting.
Sync
ObjectBox Sync makes data available and synchronized across devices, online and offline.
SyncChange
Sync incoming data event.
SyncClient
Sync client is used to connect to an ObjectBox sync server. Use through Sync.
SyncCredentials
Credentials used to authenticate a sync client against a server.
ToMany<EntityT>
Manages a to-many relation, an unidirectional link from a "source" entity to multiple objects of a "target" entity.
ToOne<EntityT>
Manages a to-one relation, an unidirectional link from a "source" entity to a "target" entity. The target object is referenced by its ID, which is persisted in the source object.
Transient
Transient annotation marks fields that should not be stored in the database.
Unique
Enforces that the value of a property is unique among all objects in a box before an object can be put.
VaultEntity_
VaultEntity entity fields to define ObjectBox queries.
Version
Wrapper for a semantic version information.

Enums

ConflictStrategy
Used with Unique to specify the conflict resolution strategy.
IndexType
IndexType can be used to change what type ObjectBox uses when indexing a property.
PropertyType
Use with Property.type.
PutMode
Box put (write) mode.
SyncConnectionEvent
Connection state change event.
SyncLoginEvent
Login state change event.
SyncRequestUpdatesMode
Configuration of how SyncClient fetches remote updates from the server.
SyncState
Current state of the SyncClient.
TxMode
Configure transaction mode. Used with Store.runInTransaction().

Extensions

DoublePropertyQuery on PropertyQuery<double>
"Property query" for a double field. Created by Query.property().
IntegerPropertyQuery on PropertyQuery<int>
"Property query" for an integer field. Created by Query.property().
ObservableStore on Store
StreamController implementation inspired by the sample controller sample at: https://dart.dev/articles/libraries/creating-streams#honoring-the-pause-state https://dart.dev/articles/libraries/code/stream_controller.dart
QueryParamBool on QueryParam<bool>
QueryParam for boolean properties
QueryParamBytes on QueryParam<List<int>>
QueryParam for byte vector properties
QueryParamDouble on QueryParam<double>
QueryParam for double properties
QueryParamInt on QueryParam<int>
QueryParam for int properties
QueryParamString on QueryParam<String>
QueryParam for string properties
QuerySetParam on Query
Adds capabilities to set query parameters
StringPropertyQuery on PropertyQuery<String>
"Property query" for a string field. Created by Query.property().

Functions

getObjectBoxModel() → ModelDefinition
ObjectBox model definition, pass it to Store - Store(getObjectBoxModel())
openStore({String? directory, int? maxDBSizeInKB, int? fileMode, int? maxReaders, bool queriesCaseSensitiveDefault = true, String? macosApplicationGroup}) Store
Open an ObjectBox store with the model declared in this file.

Exceptions / Errors

DbFileCorruptException
Errors were detected in a database file, e.g. illegal values or structural inconsistencies.
DbFullException
Thrown when applying a transaction (e.g. putting an object) would exceed the maxDBSizeInKB configured when calling Store.new.
DbMaxDataSizeExceededException
Thrown when applying a transaction would exceed the maxDataSizeInKByte configured when calling Store.new.
DbMaxReadersExceededException
Thrown when the maximum amount of readers (read transactions) was exceeded.
DbPagesCorruptException
Errors related to pages were detected in a database file, e.g. bad page refs outside of the file.
DbShutdownException
Thrown when an error occurred that requires the store to be closed.
NonUniqueResultException
Thrown if Query.findUnique() is called, but the query matches more than one object.
NumericOverflowException
Thrown if a property query aggregate function (e.g. sum()) can not compute a result due to a number type overflowing.
ObjectBoxException
ObjectBox database exception.
SchemaException
Thrown when there is an error with the data schema (data model).
StorageException
ObjectBox database exception with an OBX_ERROR code.
UniqueViolationException
A unique constraint would have been violated by this database operation.