objectbox library

ObjectBox for Dart is a standalone database storing Dart objects locally, with strong ACID semantics.

Read the Getting Started guide.

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).
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.
QueryBooleanProperty<EntityT>
QueryBuilder<T>
Query builder allows creating reusable queries.
QueryByteVectorProperty<EntityT>
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.
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.
Version
Wrapper for a semantic version information.

Extensions

DoublePropertyQuery
"Property query" for a double field. Created by Query.property().
IntegerPropertyQuery
"Property query" for an integer field. Created by Query.property().
ObservableStore
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
QueryParam for boolean properties
QueryParamBytes
QueryParam for byte vector properties
QueryParamDouble
QueryParam for double properties
QueryParamInt
QueryParam for int properties
QueryParamString
QueryParam for string properties
QuerySetParam
Adds capabilities to set query parameters
StringPropertyQuery
"Property query" for a string field. Created by Query.property().

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().

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.
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.