objectbox

ObjectBox Python API

Attributes

version

ObjectBox Python package version

Exceptions

CoreException

A database exception having a code attribute for error details.

NotFoundException

Raised when an object is not found.

Classes

Store

ObjectBox Database

Box

Interface to Entities

Id

Id Property

String

String Property

Index

Property Index

Bool

Boolean Property

Int8

Integer 8-bit Property

Int16

Integer 16-bit Property

Int32

Integer 32-bit Property

Int64

Integer 64-bit Property

Float32

Floating-point 32-bit Property

Float64

Floating-point 64-bit Property

Bytes

Bytes blob Property

BoolVector

Boolean Vector Property

Int8Vector

Integer 8-bit Vector Property

Int16Vector

Integer 16-bit Vector Property

Int32Vector

Integer 32-bit Vector Property

Int64Vector

Integer 64-bit Vector Property

Float32Vector

Floating-point 32-bit Vector Property

Float64Vector

Floating-point 64-bit Vector Property

CharVector

Char 16-bit Vector Property

BoolList

Boolean List Property

Int8List

Integer 8-bit List Property

Int16List

Integer 16-bit List Property

Int32List

Integer 32-bit List Property

Int64List

Integer 64-bit List Property

Float32List

Floating-point 32-bit List Property

Float64List

Floating-point 64-bit List Property

CharList

Char 16-bit List Property

Date

Date Property

DateNano

Date (nano-second resolution) Property

Flex

Flex dictionary-compatible Property

HnswIndex

Vector-Search HNSW Property Index

VectorDistanceType

Vector-search distance computation strategy type

HnswFlags

Vector-Search HNSW Index Flags

Model

Database schema

DebugFlags

Debug flags

PropertyQueryCondition

Query condition

Query

Query is a reusable object that allows you to find objects in the database.

QueryBuilder

Query builder

Builder

Deprecated Interface

ObjectBox

Deprecated Interface

Functions

Entity([uid, model])

Entity decorator for user classes using syntax @Entity([uid=])

version_info()

Returns a string with Python and core version information.

Package Contents

class objectbox.Store(model='default', model_json_file=None, directory=None, max_db_size_in_kb=None, max_data_size_in_kb=None, file_mode=None, max_readers=None, no_reader_thread_locals=None, model_bytes=None, model_bytes_direct=None, read_schema=None, use_previous_commit=None, read_only=None, debug_flags=None, async_max_queue_length=None, async_throttle_at_queue_length=None, async_throttle_micros=None, async_max_in_tx_duration=None, async_max_in_tx_operations=None, async_pre_txn_delay=None, async_post_txn_delay=None, async_minor_refill_threshold=None, async_minor_refill_max_count=None, async_object_bytes_max_cache_size=None, async_object_bytes_max_size_to_cache=None, c_store=None)

ObjectBox Database

Opens an ObjectBox database Store

Parameters:
  • model (Optional[Union[objectbox.model.model.Model, str]]) – Database schema model.

  • model_json_file (Optional[str]) – ObjectBox model JSON file. If not set defaults to locate user-module (from call stack) and use its directory location to use objectbox-model.json file.

  • directory (Optional[str]) – Store directory. Defaults to “objectbox”. Use prefix “memory:” to open an in-memory database, e.g. “memory:myapp”

  • max_db_size_in_kb (Optional[int]) – Maximum database size. Defaults to one gigabyte.

  • max_data_size_in_kb (Optional[int]) – Maximum data in database size tracking. Defaults to being disabled. This is a more involved size tacking. Recommended only if stricter accurate limit is required. Data size must be below database size.

  • file_mode (Optional[int]) – Unix-style file mode options. Defaults to int('644',8). This option is ignored on Windows platforms.

  • max_readers (Optional[int]) – Maximum number of readers (related to read transactions). Default value (currently 126) is suitable for most applications.

  • no_reader_thread_locals (Optional[bool]) – Disables the usage of thread locals for “readers” related to read transactions. This can make sense if you are using a lot of threads that are kept alive.

  • model_bytes (Optional[bytes]) – Database schema model given by flatbuffers bytes serialized model.

  • model_bytes_direct (Optional[bytes]) – Database schema model given by flatbuffers bytes serialized model without copying.

  • read_schema (Optional[bool]) – Advanced settings.

  • use_previous_commit (Optional[bool]) – Advanced setting recommended to set with read_only to ensure no data is lost.

  • read_only (Optional[bool]) – Open store in read-only mode: no schema update, no write transactions. Defaults to false.

  • debug_flags (Optional[objectbox.c.DebugFlags]) – Set debug flags. Defaults to DebugFlags.NONE.

  • async_max_queue_length (Optional[int]) – Maximum size of the queue before new transactions will be rejected.

  • async_throttle_at_queue_length (Optional[int]) – Throttle queue submitter when hitting this water mark.

  • async_throttle_micros (Optional[int]) – Sleeping time for throttled queue submitter.

  • async_max_in_tx_duration (Optional[int]) – Maximum duration spent in a transaction before queue enforces a commit.

  • async_max_in_tx_operations (Optional[int]) – Maximum number of operations performed in a transaction before queye enforces a commit.

  • async_pre_txn_delay (Optional[int]) – Delay (in micro seconds) before queue is triggered by new element.

  • async_post_txn_delay (Optional[int]) – Delay (in micro seconds) after a transaction was committed.

  • async_minor_refill_threshold (Optional[int]) – Number of operations to be considered a “minor refill”.

  • async_minor_refill_max_count (Optional[int]) – If set, allows “minor refills” with small batches that came in (off by default).

  • async_object_bytes_max_cache_size (Optional[int]) – Total cache size. Defaults to 0.5 mega bytes.

  • async_object_bytes_max_size_to_cache (Optional[int]) – Maximum size for an object to be cached.

  • c_store (Optional[objectbox.c.OBX_store_p]) – Internal parameter for deprecated ObjectBox interface. Do not use it; other options would be ignored if passed.

box(entity)

Open a box for an entity.

Parameters:

entity (_Entity Entity type of the model)

Return type:

objectbox.Box

read_tx()

Returns a read-only transaction.

write_tx()

Returns a write transaction.

close()

Close database.

static remove_db_files(db_dir)

Remove database files.

Parameters:

db_dir (str) – Path to DB directory.

class objectbox.Box(store, entity)

Interface to Entities

Parameters:
  • store (objectbox.store.Store)

  • entity (objectbox.model.entity._Entity)

is_empty()

Returns true if box is empty (i.e. no objects of entity type are available).

Return type:

bool

count(limit=0)

Returns the count of existing objects.

Parameters:

limit (int)

Return type:

int

put(*objects)

Puts an object (or a list of objects) and returns its ID (or nothing for a list objects)

get(id)

Get object by given Id or None if not found.

Parameters:

id (int)

get_all()

Get all objects.

Return type:

list

remove(id_or_object)

Remove object by id or object.

Return type:

bool

remove_all()

Removes all objects and returns number of removed.

Return type:

int

query(condition=None)

Initiates Query creation for the Entity associated by this Box. Technically, it creates a QueryBuilder object, and you have to call build() on it to get the Query object.

Parameters:

condition (objectbox.c.Optional[objectbox.condition.QueryCondition]) –

Applies the given condition(s) to the new QueryBuilder object. For example, assuming you defined an @Entity called “MyEntity” with a string property “name”:

query = box.query(MyEntity.name.equals("Johnny")).build()

It’s also possible to pass multiple conditions:

query = box.query(MyEntity.name.equals("Johnny") & MyEntity.age.greater(21)).build()

Note: & is the logical AND operator, and | is the logical OR operator.

Return type:

objectbox.query_builder.QueryBuilder

objectbox.Entity(uid=0, model='default')

Entity decorator for user classes using syntax @Entity([uid=])

Example:

@Entity()
class MyEntity:
    id = Id
    name = String(index=Index)

Wraps the given user classes as an _Entity helper class.

Parameters:
  • uid (int)

  • model (str)

Return type:

_Entity

class objectbox.Id(id=0, uid=0, py_type=int)

Id Property

Parameters:
  • id (int)

  • uid (int)

  • py_type (type)

equals(value)

Equals (==) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

not_equals(value)

Not equals (!=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

greater_than(value)

Greater-than (>) condition to be passed to objectbox.Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

greater_or_equal(value)

Greater-or-equal (>=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

less_than(value)

Less-than (<) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

less_or_equal(value)

Less-or-equal (<=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

between(a, b)

Between a and b (a <= x <= b) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.String(id=0, uid=0, **kwargs)

String Property

Parameters:
  • id (int)

  • uid (int)

starts_with(value, case_sensitive=True)

starts with (string-prefix) condition (opt-in: case-sensitive) to be passed to Box.query()

Parameters:
  • value (str)

  • case_sensitive (bool)

Return type:

objectbox.condition.PropertyQueryCondition

ends_with(value, case_sensitive=True)

ends with (string-suffix) condition (opt-in: case-sensitive) to be passed to Box.query()

Parameters:
  • value (str)

  • case_sensitive (bool)

Return type:

objectbox.condition.PropertyQueryCondition

equals(value, case_sensitive=True)

equals (==) condition (opt-in: case-sensitive) to be passed to Box.query()

Parameters:

case_sensitive (bool)

Return type:

objectbox.condition.PropertyQueryCondition

not_equals(value, case_sensitive=True)

not-equals (~=) condition (opt-in: case-sensitive) to be passed to Box.query()

Parameters:

case_sensitive (bool)

Return type:

objectbox.condition.PropertyQueryCondition

contains(value, case_sensitive=True)

contains string condition (opt-in: case-sensitive) to be passed to Box.query()

Parameters:
  • value (str)

  • case_sensitive (bool)

Return type:

objectbox.condition.PropertyQueryCondition

greater_than(value, case_sensitive=True)

greater-than condition (opt-in: case-sensitive) to be passed to Box.query()

Parameters:

case_sensitive (bool)

Return type:

objectbox.condition.PropertyQueryCondition

greater_or_equal(value, case_sensitive=True)

greater-or-equal condition (opt-in: case-sensitive) to be passed to Box.query()

Parameters:

case_sensitive (bool)

Return type:

objectbox.condition.PropertyQueryCondition

less_than(value, case_sensitive=True)

less-than condition (opt-in: case-sensitive) to be passed to Box.query()

Parameters:

case_sensitive (bool)

Return type:

objectbox.condition.PropertyQueryCondition

less_or_equal(value, case_sensitive=True)

less-or-equal condition (opt-in: case-sensitive) to be passed to Box.query()

Parameters:

case_sensitive (bool)

Return type:

objectbox.condition.PropertyQueryCondition

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.Index(type=IndexType.VALUE, uid=0)

Property Index

Parameters:
  • type (IndexType)

  • uid (int)

property id
Index Id
property uid
Index UId
has_uid()
class objectbox.Bool(id=0, uid=0, **kwargs)

Boolean Property

Parameters:
  • id (int)

  • uid (int)

equals(value)

Equals (==) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

not_equals(value)

Not equals (!=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

greater_than(value)

Greater-than (>) condition to be passed to objectbox.Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

greater_or_equal(value)

Greater-or-equal (>=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

less_than(value)

Less-than (<) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

less_or_equal(value)

Less-or-equal (<=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

between(a, b)

Between a and b (a <= x <= b) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.Int8(id=0, uid=0, **kwargs)

Integer 8-bit Property

Parameters:
  • id (int)

  • uid (int)

equals(value)

Equals (==) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

not_equals(value)

Not equals (!=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

greater_than(value)

Greater-than (>) condition to be passed to objectbox.Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

greater_or_equal(value)

Greater-or-equal (>=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

less_than(value)

Less-than (<) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

less_or_equal(value)

Less-or-equal (<=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

between(a, b)

Between a and b (a <= x <= b) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.Int16(id=0, uid=0, **kwargs)

Integer 16-bit Property

Parameters:
  • id (int)

  • uid (int)

equals(value)

Equals (==) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

not_equals(value)

Not equals (!=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

greater_than(value)

Greater-than (>) condition to be passed to objectbox.Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

greater_or_equal(value)

Greater-or-equal (>=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

less_than(value)

Less-than (<) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

less_or_equal(value)

Less-or-equal (<=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

between(a, b)

Between a and b (a <= x <= b) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.Int32(id=0, uid=0, **kwargs)

Integer 32-bit Property

Parameters:
  • id (int)

  • uid (int)

equals(value)

Equals (==) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

not_equals(value)

Not equals (!=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

greater_than(value)

Greater-than (>) condition to be passed to objectbox.Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

greater_or_equal(value)

Greater-or-equal (>=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

less_than(value)

Less-than (<) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

less_or_equal(value)

Less-or-equal (<=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

between(a, b)

Between a and b (a <= x <= b) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.Int64(id=0, uid=0, **kwargs)

Integer 64-bit Property

Parameters:
  • id (int)

  • uid (int)

equals(value)

Equals (==) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

not_equals(value)

Not equals (!=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

greater_than(value)

Greater-than (>) condition to be passed to objectbox.Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

greater_or_equal(value)

Greater-or-equal (>=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

less_than(value)

Less-than (<) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

less_or_equal(value)

Less-or-equal (<=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

between(a, b)

Between a and b (a <= x <= b) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.Float32(id=0, uid=0, **kwargs)

Floating-point 32-bit Property

Parameters:
  • id (int)

  • uid (int)

greater_than(value)

Greater-than (>) condition to be passed to objectbox.Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

greater_or_equal(value)

Greater-or-equal (>=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

less_than(value)

Less-than (<) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

less_or_equal(value)

Less-or-equal (<=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

between(a, b)

Between a and b (a <= x <= b) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.Float64(id=0, uid=0, **kwargs)

Floating-point 64-bit Property

Parameters:
  • id (int)

  • uid (int)

greater_than(value)

Greater-than (>) condition to be passed to objectbox.Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

greater_or_equal(value)

Greater-or-equal (>=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

less_than(value)

Less-than (<) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

less_or_equal(value)

Less-or-equal (<=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

between(a, b)

Between a and b (a <= x <= b) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.Bytes(id=0, uid=0, **kwargs)

Bytes blob Property

Parameters:
  • id (int)

  • uid (int)

equals(value)

byte-string equals (==) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

greater_than(value)

byte-string greater-than (==) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

greater_or_equal(value)

byte-string greater-or-equal (>=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

less_than(value)

byte-string less-than (<) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

less_or_equal(value)

byte-string less-or-equal (<) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

between(a, b)

Between a and b (a <= x <= b) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.BoolVector(id=0, uid=0, **kwargs)

Boolean Vector Property

Parameters:
  • id (int)

  • uid (int)

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.Int8Vector(id=0, uid=0, **kwargs)

Integer 8-bit Vector Property

Parameters:
  • id (int)

  • uid (int)

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.Int16Vector(id=0, uid=0, **kwargs)

Integer 16-bit Vector Property

Parameters:
  • id (int)

  • uid (int)

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.Int32Vector(id=0, uid=0, **kwargs)

Integer 32-bit Vector Property

Parameters:
  • id (int)

  • uid (int)

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.Int64Vector(id=0, uid=0, **kwargs)

Integer 64-bit Vector Property

Parameters:
  • id (int)

  • uid (int)

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.Float32Vector(id=0, uid=0, **kwargs)

Floating-point 32-bit Vector Property

Parameters:
  • id (int)

  • uid (int)

nearest_neighbor(query_vector, element_count)
Parameters:

element_count (int)

Return type:

objectbox.condition.PropertyQueryCondition

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.Float64Vector(id=0, uid=0, **kwargs)

Floating-point 64-bit Vector Property

Parameters:
  • id (int)

  • uid (int)

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.CharVector(id=0, uid=0, **kwargs)

Char 16-bit Vector Property

Parameters:
  • id (int)

  • uid (int)

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.BoolList(id=0, uid=0, **kwargs)

Boolean List Property

Parameters:
  • id (int)

  • uid (int)

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.Int8List(id=0, uid=0, **kwargs)

Integer 8-bit List Property

Parameters:
  • id (int)

  • uid (int)

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.Int16List(id=0, uid=0, **kwargs)

Integer 16-bit List Property

Parameters:
  • id (int)

  • uid (int)

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.Int32List(id=0, uid=0, **kwargs)

Integer 32-bit List Property

Parameters:
  • id (int)

  • uid (int)

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.Int64List(id=0, uid=0, **kwargs)

Integer 64-bit List Property

Parameters:
  • id (int)

  • uid (int)

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.Float32List(id=0, uid=0, **kwargs)

Floating-point 32-bit List Property

Parameters:
  • id (int)

  • uid (int)

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.Float64List(id=0, uid=0, **kwargs)

Floating-point 64-bit List Property

Parameters:
  • id (int)

  • uid (int)

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.CharList(id=0, uid=0, **kwargs)

Char 16-bit List Property

Parameters:
  • id (int)

  • uid (int)

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.Date(py_type=datetime, id=0, uid=0, **kwargs)

Date Property

Parameters:
  • id (int)

  • uid (int)

equals(value)

Equals (==) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

not_equals(value)

Not equals (!=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

greater_than(value)

Greater-than (>) condition to be passed to objectbox.Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

greater_or_equal(value)

Greater-or-equal (>=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

less_than(value)

Less-than (<) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

less_or_equal(value)

Less-or-equal (<=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

between(a, b)

Between a and b (a <= x <= b) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.DateNano(py_type=datetime, id=0, uid=0, **kwargs)

Date (nano-second resolution) Property

Parameters:
  • id (int)

  • uid (int)

equals(value)

Equals (==) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

not_equals(value)

Not equals (!=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

greater_than(value)

Greater-than (>) condition to be passed to objectbox.Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

greater_or_equal(value)

Greater-or-equal (>=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

less_than(value)

Less-than (<) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

less_or_equal(value)

Less-or-equal (<=) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

between(a, b)

Between a and b (a <= x <= b) condition to be passed to Box.query()

Return type:

objectbox.condition.PropertyQueryCondition

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.Flex(id=0, uid=0, **kwargs)

Flex dictionary-compatible Property

Parameters:
  • id (int)

  • uid (int)

contains_key_value(key, value, case_sensitive=True)

contains key/valuel condition to be passed to Box.query()

Parameters:
  • key (str)

  • value (str)

  • case_sensitive (bool)

Return type:

objectbox.condition.PropertyQueryCondition

property id
Property Id
property uid
Property Uid
has_uid()

Returns true if property has a valid Uid

is_id()

Check if Property is an Id Property.

Return type:

bool

on_sync()

Method called once ID/UID are synced with the model file.

class objectbox.HnswIndex(dimensions, neighbors_per_node=None, indexing_search_count=None, flags=HnswFlags.NONE, distance_type=VectorDistanceType.EUCLIDEAN, reparation_backlink_probability=None, vector_cache_hint_size_kb=None, uid=0)

Vector-Search HNSW Property Index

Parameters:
  • dimensions (int) – Vector dimensionality.

  • neighbors_per_node (objectbox.c.Optional[int]) – Maximum number of neighbors per node (aka “M”). Higher number increases the graph connectivity which can lead to better results, but higher resources usage. If no value is set, a default value taken (currently 30). Try e.g. 16 for faster but less accurate results, or 64 for more accurate results.

  • indexing_search_count (objectbox.c.Optional[int]) – Maximum number of neighbors searched while indexing (aka “efConstruction”). If not set, internally default value is currently set to 100, which can change in future version. The default value serves as a starting point that can likely be optimized for specific datasets and use cases. The higher the value, the more accurate the search, but the longer the indexing will take. If indexing time is not a major concern, a value of at least 200 is recommended to improve search quality. blah.

  • flags (HnswFlags) – Set flags.

  • distance_type (VectorDistanceType) – Set distance strategy type.

  • reparation_backlink_probability (objectbox.c.Optional[float]) – When repairing the graph after a node was removed, this gives the probability of adding backlinks to the repaired neighbors. The default is 1.0 (aka “always”) as this should be worth a bit of extra costs as it improves the graph’s quality.

  • vector_cache_hint_size_kb (objectbox.c.Optional[float]) – Vector cache hint size. This is a non-binding hint of the maximum size of the vector cache in KB (default: 2097152 or 2 GB/GiB).

  • uid (int)

property id
Index Id
property uid
Index Uid
has_uid()

Returns true if Uid is set.

class objectbox.VectorDistanceType

Vector-search distance computation strategy type

Initialize self. See help(type(self)) for accurate signature.

UNKNOWN

Not a real type, just best practice (e.g. forward compatibility)

EUCLIDEAN

The default; typically ‘euclidean squared’ internally.”

COSINE

Cosine similarity compares two vectors irrespective of their magnitude (compares the angle of two vectors). Often used for document or semantic similarity. Value range: 0.0 - 2.0 (0.0: same direction, 1.0: orthogonal, 2.0: opposite direction)

DOT_PRODUCT

For normalized vectors (vector length == 1.0), the dot product is equivalent to the cosine similarity. Because of this, the dot product is often preferred as it performs better. Value range (normalized vectors): 0.0 - 2.0 (0.0: same direction, 1.0: orthogonal, 2.0: opposite direction)

DOT_PRODUCT_NON_NORMALIZED

A custom dot product similarity measure that does not require the vectors to be normalized. Note: this is no replacement for cosine similarity (like DotProduct for normalized vectors is). The non-linear conversion provides a high precision over the entire float range (for the raw dot product). The higher the dot product, the lower the distance is (the nearer the vectors are). The more negative the dot product, the higher the distance is (the farther the vectors are). Value range: 0.0 - 2.0 (nonlinear; 0.0: nearest, 1.0: orthogonal, 2.0: farthest)

as_integer_ratio()

Return integer ratio.

Return a pair of integers, whose ratio is exactly equal to the original int and with a positive denominator.

>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)
bit_count()

Number of ones in the binary representation of the absolute value of self.

Also known as the population count.

>>> bin(13)
'0b1101'
>>> (13).bit_count()
3
bit_length()

Number of bits necessary to represent self in binary.

>>> bin(37)
'0b100101'
>>> (37).bit_length()
6
conjugate()

Returns self, the complex conjugate of any int.

class denominator

the denominator of a rational number in lowest terms

class imag

the imaginary part of a complex number

class numerator

the numerator of a rational number in lowest terms

class real

the real part of a complex number

to_bytes()

Return an array of bytes representing an integer.

length

Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes.

byteorder

The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value.

signed

Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

name()

The name of the Enum member.

value()

The value of the Enum member.

class objectbox.HnswFlags

Vector-Search HNSW Index Flags

Initialize self. See help(type(self)) for accurate signature.

NONE = 0
DEBUG_LOGS = 1

Enables debug logs.

DEBUG_LOGS_DETAILED = 2

Enables “high volume” debug logs, e.g. individual gets/puts.

VECTOR_CACHE_SIMD_PADDING_OFF = 4

Padding for SIMD is enabled by default, which uses more memory but may be faster. This flag turns it off.

REPARATION_LIMIT_CANDIDATES = 8

If the speed of removing nodes becomes a concern in your use case, you can speed it up by setting this flag. By default, repairing the graph after node removals creates more connections to improve the graph’s quality. The extra costs for this are relatively low (e.g. vs. regular indexing), and thus the default is recommended.

as_integer_ratio()

Return integer ratio.

Return a pair of integers, whose ratio is exactly equal to the original int and with a positive denominator.

>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)
bit_count()

Number of ones in the binary representation of the absolute value of self.

Also known as the population count.

>>> bin(13)
'0b1101'
>>> (13).bit_count()
3
bit_length()

Number of bits necessary to represent self in binary.

>>> bin(37)
'0b100101'
>>> (37).bit_length()
6
conjugate()

Returns self, the complex conjugate of any int.

class denominator

the denominator of a rational number in lowest terms

class imag

the imaginary part of a complex number

class numerator

the numerator of a rational number in lowest terms

class real

the real part of a complex number

to_bytes()

Return an array of bytes representing an integer.

length

Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes.

byteorder

The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value.

signed

Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

name()

The name of the Enum member.

value()

The value of the Enum member.

class objectbox.Model

Database schema

A model specifies available entities in the database. Amongst others it uses this information to supports migration over time.

on_sync()

Method called once ID/UID are synced with the model file.

entity(entity)
Parameters:

entity (objectbox.model.entity._Entity)

validate_ids_assigned()
exception objectbox.CoreException(code)

A database exception having a code attribute for error details.

Initialize self. See help(type(self)) for accurate signature.

Parameters:

code (int)

codes
static last()

Creates a CoreException of the last error that was generated in core.

class args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception objectbox.NotFoundException

Raised when an object is not found.

Initialize self. See help(type(self)) for accurate signature.

codes
static last()

Creates a CoreException of the last error that was generated in core.

class args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class objectbox.DebugFlags

Debug flags

Initialize self. See help(type(self)) for accurate signature.

NONE = (0,)
LOG_TRANSACTIONS_READ = (1,)

Log read transactions

LOG_TRANSACTIONS_WRITE = (2,)

Log write transactions

LOG_QUERIES = (3,)

Log queries

LOG_QUERY_PARAMETERS = (8,)

Log query parameters

LOG_ASYNC_QUEUE = (16,)

Log async queue

LOG_CACHE_HITS = (32,)

Log cache hits

LOG_CACHE_ALL = (64,)

Log cache hits

LOG_TREE = 128

Log tree operations

as_integer_ratio()

Return integer ratio.

Return a pair of integers, whose ratio is exactly equal to the original int and with a positive denominator.

>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)
bit_count()

Number of ones in the binary representation of the absolute value of self.

Also known as the population count.

>>> bin(13)
'0b1101'
>>> (13).bit_count()
3
bit_length()

Number of bits necessary to represent self in binary.

>>> bin(37)
'0b100101'
>>> (37).bit_length()
6
conjugate()

Returns self, the complex conjugate of any int.

class denominator

the denominator of a rational number in lowest terms

class imag

the imaginary part of a complex number

class numerator

the numerator of a rational number in lowest terms

class real

the real part of a complex number

to_bytes()

Return an array of bytes representing an integer.

length

Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes.

byteorder

The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value.

signed

Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

name()

The name of the Enum member.

value()

The value of the Enum member.

class objectbox.PropertyQueryCondition(property_id, op, args)

Query condition

Query conditions describe operations to be applied on a property (e.g. name == “John”, age == 24)

Parameters:
  • property_id (int)

  • op (PropertyQueryConditionOp)

  • args (Dict[str, Any])

alias(value)

Sets an alias for this condition that can later be used with Query’s set_parameter_* methods.

Parameters:

value (str)

apply(qb)

Applies the QueryCondition to the supplied QueryBuilder.

Returns:

The C handle for the applied condition.

Parameters:

qb (objectbox.query_builder.QueryBuilder)

Return type:

objectbox.c.obx_qb_cond

and_(other)

and logic condition or using & operator

Parameters:

other (QueryCondition)

Return type:

QueryCondition

or_(other)

or logic condition or using | operator

Parameters:

other (QueryCondition)

Return type:

QueryCondition

class objectbox.Query(c_query, box)

Query is a reusable object that allows you to find objects in the database. It is created by calling Box.query() with conditions inside and finalizing with build(). Note: Query objects are not thread-safe and should not be shared between threads.

This is an internal constructor. Use Box.query() instead.

Parameters:

box (Box)

find()

Finds a list of objects matching query.

Return type:

list

find_ids()

Finds a list of object IDs matching query. The result is sorted by ID (ascending order).

Return type:

objectbox.c.List[int]

find_with_scores()

Finds objects matching the query associated to their query score (e.g. distance in NN search). The result is sorted by score in ascending order.

find_ids_with_scores()

Finds object IDs matching the query associated to their query score (e.g. distance in NN search). The resulting list is sorted by score in ascending order.

Return type:

objectbox.c.List[objectbox.c.Tuple[int, float]]

find_ids_by_score()

Finds object IDs matching the query ordered by their query score (e.g. distance in NN search). The resulting list of IDs is sorted by score in ascending order.

Return type:

objectbox.c.List[int]

find_ids_by_score_numpy()

Finds object IDs matching the query ordered by their query score (e.g. distance in NN search). The resulting list of IDs is sorted by score in ascending order.

Return type:

objectbox.c.np.array

count()

Counts the objects that are matched by this query. In other words, it gives the size of the result set).

Return type:

int

remove()

Removes the objects that are matched by this query.

Return type:

int

offset(offset)

Configure an offset for this query. All methods that support offset will return/process objects starting at this offset. Example use case: use together with limit to get a slice of the whole result, e.g. for “result paging”. Call with offset=0 to reset to the default behavior, i.e. starting from the first element.

Parameters:

offset (int)

limit(limit)

Configure a limit for this query. All methods that support limit will return/process only the given number of objects. Example use case: use together with offset to get a slice of the whole result, e.g. for “result paging”. Call with limit=0 to reset to the default behavior - zero limit means no limit applied.

Parameters:

limit (int)

set_parameter_string(prop, value)
Parameters:
  • prop (objectbox.c.Union[int, str, Property])

  • value (str)

Return type:

Query

set_parameter_int(prop, value)
Parameters:
  • prop (objectbox.c.Union[int, str, Property])

  • value (int)

Return type:

Query

set_parameter_vector_f32(prop, value)
Parameters:
  • prop (objectbox.c.Union[int, str, Property])

  • value (objectbox.c.Union[objectbox.c.List[float], objectbox.c.np.ndarray])

Return type:

Query

offset(offset)
Parameters:

offset (int)

limit(limit)
Parameters:

limit (int)

set_parameter_alias_string(alias, value)
Parameters:
  • alias (str)

  • value (str)

set_parameter_alias_int(alias, value)
Parameters:
  • alias (str)

  • value (int)

set_parameter_alias_vector_f32(alias, value)
Parameters:
  • alias (str)

  • value (objectbox.c.Union[objectbox.c.List[float], objectbox.c.np.ndarray])

class objectbox.QueryBuilder(store, box)

Query builder

Parameters:
  • store (objectbox.store.Store)

  • box (Box)

close()
Return type:

int

error_code()
Return type:

int

error_message()
Return type:

str

equals_string(prop, value, case_sensitive=True)
Parameters:
  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • value (str)

  • case_sensitive (bool)

Return type:

objectbox.c.obx_qb_cond

not_equals_string(prop, value, case_sensitive=True)
Parameters:
  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • value (str)

  • case_sensitive (bool)

Return type:

objectbox.c.obx_qb_cond

contains_string(prop, value, case_sensitive=True)
Parameters:
  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • value (str)

  • case_sensitive (bool)

Return type:

objectbox.c.obx_qb_cond

starts_with_string(prop, value, case_sensitive=True)
Parameters:
  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • value (str)

  • case_sensitive (bool)

Return type:

objectbox.c.obx_qb_cond

ends_with_string(prop, value, case_sensitive=True)
Parameters:
  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • value (str)

  • case_sensitive (bool)

Return type:

objectbox.c.obx_qb_cond

greater_than_string(prop, value, case_sensitive=True)
Parameters:
  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • value (str)

  • case_sensitive (bool)

Return type:

objectbox.c.obx_qb_cond

greater_or_equal_string(prop, value, case_sensitive=True)
Parameters:
  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • value (str)

  • case_sensitive (bool)

Return type:

objectbox.c.obx_qb_cond

less_than_string(prop, value, case_sensitive=True)
Parameters:
  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • value (str)

  • case_sensitive (bool)

Return type:

objectbox.c.obx_qb_cond

less_or_equal_string(prop, value, case_sensitive=True)
Parameters:
  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • value (str)

  • case_sensitive (bool)

Return type:

objectbox.c.obx_qb_cond

equals_int(prop, value)
Parameters:
  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • value (int)

Return type:

objectbox.c.obx_qb_cond

not_equals_int(prop, value)
Parameters:
  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • value (int)

Return type:

objectbox.c.obx_qb_cond

greater_than_int(prop, value)
Parameters:
  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • value (int)

Return type:

objectbox.c.obx_qb_cond

greater_than_double(prop, value)
Parameters:
  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • value (float)

Return type:

objectbox.c.obx_qb_cond

greater_or_equal_int(prop, value)
Parameters:
  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • value (int)

Return type:

objectbox.c.obx_qb_cond

greater_or_equal_double(prop, value)
Parameters:
  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • value (float)

Return type:

objectbox.c.obx_qb_cond

less_than_int(prop, value)
Parameters:
  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • value (int)

Return type:

objectbox.c.obx_qb_cond

less_than_double(prop, value)
Parameters:
  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • value (float)

Return type:

objectbox.c.obx_qb_cond

less_or_equal_int(prop, value)
Parameters:
  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • value (int)

Return type:

objectbox.c.obx_qb_cond

less_or_equal_double(prop, value)
Parameters:
  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • value (float)

Return type:

objectbox.c.obx_qb_cond

between_2ints(prop, value_a, value_b)
Parameters:
  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • value_a (int)

  • value_b (int)

Return type:

objectbox.c.obx_qb_cond

between_2doubles(prop, value_a, value_b)
Parameters:
  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • value_a (float)

  • value_b (float)

Return type:

objectbox.c.obx_qb_cond

equals_bytes(prop, value)
Parameters:
  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • value (bytes)

Return type:

objectbox.c.obx_qb_cond

greater_than_bytes(prop, value)
Parameters:
  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • value (bytes)

Return type:

objectbox.c.obx_qb_cond

greater_or_equal_bytes(prop, value)
Parameters:
  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • value (bytes)

Return type:

objectbox.c.obx_qb_cond

less_than_bytes(prop, value)
Parameters:
  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • value (bytes)

Return type:

objectbox.c.obx_qb_cond

less_or_equal_bytes(prop, value)
Parameters:
  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • value (bytes)

Return type:

objectbox.c.obx_qb_cond

nearest_neighbors_f32(prop, query_vector, element_count)
Parameters:
  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • query_vector (objectbox.c.Union[objectbox.c.np.ndarray, objectbox.c.List[float]])

  • element_count (int)

contains_key_value(prop, key, value, case_sensitive=True)

Checks whether the given Flex property, interpreted as a dictionary and indexed at key, has a value corresponding to the given value.

Parameters:
  • case_sensitive (bool) – If false, ignore case when matching value

  • prop (objectbox.c.Union[int, str, objectbox.model.properties.Property])

  • key (str)

  • value (str)

Return type:

objectbox.c.obx_qb_cond

any(conditions)
Parameters:

conditions (objectbox.c.List[objectbox.c.obx_qb_cond])

Return type:

objectbox.c.obx_qb_cond

all(conditions)
Parameters:

conditions (objectbox.c.List[objectbox.c.obx_qb_cond])

Return type:

objectbox.c.obx_qb_cond

build()
Return type:

objectbox.query.Query

alias(alias)
Parameters:

alias (str)

class objectbox.Builder

Deprecated Interface

This throws a deprecation warning on initialization.

directory(path)
Parameters:

path (str)

Return type:

Builder

max_db_size_in_kb(size_in_kb)
Parameters:

size_in_kb (int)

Return type:

Builder

model(model)
Parameters:

model (objectbox.model.model.Model)

Return type:

Builder

build()
Return type:

objectbox.store.Store

class objectbox.ObjectBox(c_store)

Deprecated Interface

This throws a deprecation warning on initialization.

box(entity)

Open a box for an entity.

Parameters:

entity (_Entity Entity type of the model)

Return type:

objectbox.Box

read_tx()

Returns a read-only transaction.

write_tx()

Returns a write transaction.

close()

Close database.

static remove_db_files(db_dir)

Remove database files.

Parameters:

db_dir (str) – Path to DB directory.

objectbox.version

ObjectBox Python package version

objectbox.version_info()

Returns a string with Python and core version information.