objectbox-go: github.com/objectbox/objectbox-go/objectbox Index | Files | Directories

package objectbox

import "github.com/objectbox/objectbox-go/objectbox"

Package objectbox provides a super-fast, light-weight object persistence framework.

You can define your entity as a standard .go struct, with a comment signalling to generate ObjectBox code

//go:generate objectbox-gogen

type Person struct {
   Id        uint64 `id`
   FirstName string
   LastName  string
}

Now, just init ObjectBox using the generated code (don't forget to errors in your real code, they are discarded here to keep the example concise)

ob, _ := objectbox.NewBuilder().Model(ObjectBoxModel()).Build()
defer ob.Close()

box := BoxForPerson(ob)

// Create
id, _ := box.Put(&Person{
   FirstName: "Joe",
   LastName:  "Green",
})

// Read
person, _ := box.Get(id)

// Update
person.LastName = "Black"
box.Put(person)

// Delete
box.Remove(person)

To learn more, see https://golang.objectbox.io/

Index

Package Files

box.go builder.go c-arrays.go condition.go cursor.go doc.go entity.go internaltestaccess.go model.go objectbox.go property.go query.go querybuilder.go transaction.go version.go

Constants

const (
    PropertyType_Bool       = 1
    PropertyType_Byte       = 2
    PropertyType_Short      = 3
    PropertyType_Char       = 4
    PropertyType_Int        = 5
    PropertyType_Long       = 6
    PropertyType_Float      = 7
    PropertyType_Double     = 8
    PropertyType_String     = 9
    PropertyType_Date       = 10
    PropertyType_Relation   = 11
    PropertyType_ByteVector = 23
)

noinspection GoUnusedConst

const (
    /// One long property on an entity must be the ID
    PropertyFlags_ID = 1

    /// On languages like Java, a non-primitive type is used (aka wrapper types, allowing null)
    PropertyFlags_NON_PRIMITIVE_TYPE = 2

    /// Unused yet
    PropertyFlags_NOT_NULL = 4
    PropertyFlags_INDEXED  = 8
    PropertyFlags_RESERVED = 16
    /// Unused yet: Unique index
    PropertyFlags_UNIQUE = 32
    /// Unused yet: Use a persisted sequence to enforce ID to rise monotonic (no ID reuse)
    PropertyFlags_ID_MONOTONIC_SEQUENCE = 64
    /// Allow IDs to be assigned by the developer
    PropertyFlags_ID_SELF_ASSIGNABLE = 128
    /// Unused yet
    PropertyFlags_INDEX_PARTIAL_SKIP_NULL = 256
    /// Unused yet, used by References for 1) back-references and 2) to clear references to deleted objects (required for ID reuse)
    PropertyFlags_INDEX_PARTIAL_SKIP_ZERO = 512
    /// Virtual properties may not have a dedicated field in their entity class, e.g. target IDs of to-one relations
    PropertyFlags_VIRTUAL = 1024

    PropertyFlags_INDEX_HASH = 2048
    /// Index uses a 64 bit hash instead of the value
    /// (recommended mostly for 64 bit machines with values longer >200 bytes; small values are faster with a 32 bit hash)
    PropertyFlags_INDEX_HASH64 = 4096
)

noinspection GoUnusedConst

const (
    DebugFlags_LOG_TRANSACTIONS_READ  = 1
    DebugFlags_LOG_TRANSACTIONS_WRITE = 2
    DebugFlags_LOG_QUERIES            = 4
    DebugFlags_LOG_QUERY_PARAMETERS   = 8
    DebugFlags_LOG_ASYNC_QUEUE        = 16
)

noinspection GoUnusedConst

func VersionInfo Uses

func VersionInfo() string

A printable version string

type Box Uses

type Box struct {
    // contains filtered or unexported fields
}

Box provides CRUD access to objects of a common type

func (*Box) Count Uses

func (box *Box) Count() (count uint64, err error)

Count returns a number of objects stored

func (*Box) Get Uses

func (box *Box) Get(id uint64) (object interface{}, err error)

Get reads a single object.

Returns an interface that should be cast to the appropriate type. Returns nil in case the object with the given ID doesn't exist. The cast is done automatically when using the generated BoxFor* code

func (*Box) GetAll Uses

func (box *Box) GetAll() (slice interface{}, err error)

Get reads a all stored objects

Returns a slice of objects that should be cast to the appropriate type. The cast is done automatically when using the generated BoxFor* code

func (*Box) Put Uses

func (box *Box) Put(object interface{}) (id uint64, err error)

Put synchronously inserts/updates a single object. In case the ID is not specified, it would be assigned automatically (auto-increment). When inserting, the ID property on the passed object will be assigned the new ID as well.

func (*Box) PutAll Uses

func (box *Box) PutAll(slice interface{}) (ids []uint64, err error)

PutAll inserts multiple objects in single transaction. The given argument must be a slice of the object type this Box represents (pointers to objects). In case IDs are not set on the objects, they would be assigned automatically (auto-increment).

Returns: IDs of the put objects (in the same order).

Note: In case an error occurs during the transaction, some of the objects may already have the ID assigned even though the transaction has been rolled back and the objects are not stored under those IDs.

Note: The slice may be empty or even nil; in both cases, an empty IDs slice and no error is returned.

func (*Box) PutAsync Uses

func (box *Box) PutAsync(object interface{}) (id uint64, err error)

PutAsync asynchronously inserts/updates a single object. When inserting, the ID property on the passed object will be assigned the new ID as well.

It's executed on a separate internal thread for better performance.

There are two main use cases:

1) "Put & Forget:" you gain faster puts as you don't have to wait for the transaction to finish.

2) Many small transactions: if your write load is typically a lot of individual puts that happen in parallel, this will merge small transactions into bigger ones. This results in a significant gain in overall throughput.

In situations with (extremely) high async load, this method may be throttled (~1ms) or delayed (<1s). In the unlikely event that the object could not be enqueued after delaying, an error will be returned.

Note that this method does not give you hard durability guarantees like the synchronous Put provides. There is a small time window (typically 3 ms) in which the data may not have been committed durably yet.

func (*Box) Query Uses

func (box *Box) Query(conditions ...Condition) *Query

Creates a query with the given conditions. Use generated properties to create conditions. Keep the Query object if you intend to execute it multiple times. Note: this function panics if you try to create illegal queries; e.g. use properties of an alien type. This is typically a programming error. Use QueryOrError instead if you want the explicit error check.

func (*Box) QueryOrError Uses

func (box *Box) QueryOrError(conditions ...Condition) (*Query, error)

Like Query() but with error handling; e.g. when you build conditions dynamically that may fail.

func (*Box) Remove Uses

func (box *Box) Remove(id uint64) (err error)

Remove deletes a single object

func (*Box) RemoveAll Uses

func (box *Box) RemoveAll() (err error)

RemoveAll removes all stored objects. This is much faster than removing objects one by one in a loop.

type Builder Uses

type Builder struct {
    Error error
    // contains filtered or unexported fields
}

Builder provides tools to fully configure and construct ObjectBox

func NewBuilder Uses

func NewBuilder() *Builder

func (*Builder) Build Uses

func (builder *Builder) Build() (*ObjectBox, error)

Build validates the configuration and tries to init the ObjectBox. This call panics on failures; if ObjectBox is optional for your app, consider BuildOrError().

func (*Builder) BuildOrError Uses

func (builder *Builder) BuildOrError() (*ObjectBox, error)

Build validates the configuration and tries to init the ObjectBox.

func (*Builder) Directory Uses

func (builder *Builder) Directory(name string) *Builder

Directory configures the path where the database is stored

func (*Builder) MaxReaders Uses

func (builder *Builder) MaxReaders(maxReaders uint) *Builder

Maximum (concurrent) readers (default: 126). Increase only if you are getting errors (highly concurrent scenarios).

func (*Builder) MaxSizeInKb Uses

func (builder *Builder) MaxSizeInKb(maxSizeInKb uint64) *Builder

MaxSizeInKb defines maximum size the database can take on disk (default: 1 GByte).

func (*Builder) Model Uses

func (builder *Builder) Model(model *Model) *Builder

Model specifies schema for the database.

Pass the result of the generated function ObjectBoxModel as an argument: Model(ObjectBoxModel())

type Condition Uses

type Condition interface {
    // contains filtered or unexported methods
}

type ConditionId Uses

type ConditionId = int

type Entity Uses

type Entity struct {
    Id TypeId
}

type InternalTestAccessObjectBox Uses

type InternalTestAccessObjectBox struct {
    ObjectBox *ObjectBox
}

Internal: Reserved for internal unit tests only and won't be exposed in the future

func (*InternalTestAccessObjectBox) RunInTxn Uses

func (obx *InternalTestAccessObjectBox) RunInTxn(readOnly bool, txnFun txnFun) (err error)

type Model Uses

type Model struct {
    Error error
    // contains filtered or unexported fields
}

Model is used by the generated code to represent information about the ObjectBox database schema

func NewModel Uses

func NewModel() *Model

func (*Model) Entity Uses

func (model *Model) Entity(name string, id TypeId, uid uint64)

func (*Model) EntityLastPropertyId Uses

func (model *Model) EntityLastPropertyId(id TypeId, uid uint64)

func (*Model) GeneratorVersion Uses

func (model *Model) GeneratorVersion(version int)

func (*Model) LastEntityId Uses

func (model *Model) LastEntityId(id TypeId, uid uint64)

func (*Model) LastIndexId Uses

func (model *Model) LastIndexId(id TypeId, uid uint64)

func (*Model) LastRelationId Uses

func (model *Model) LastRelationId(id TypeId, uid uint64)

func (*Model) Property Uses

func (model *Model) Property(name string, propertyType int, id TypeId, uid uint64)

func (*Model) PropertyFlags Uses

func (model *Model) PropertyFlags(propertyFlags int)

func (*Model) PropertyIndex Uses

func (model *Model) PropertyIndex(id TypeId, uid uint64)

func (*Model) PropertyRelation Uses

func (model *Model) PropertyRelation(targetEntityName string, indexId TypeId, indexUid uint64)

func (*Model) RegisterBinding Uses

func (model *Model) RegisterBinding(binding ObjectBinding)

type ObjectBinding Uses

type ObjectBinding interface {
    AddToModel(model *Model)
    GetId(object interface{}) (id uint64, err error)
    // TODO SetId never errs
    SetId(object interface{}, id uint64) error
    Flatten(object interface{}, fbb *flatbuffers.Builder, id uint64)
    ToObject(bytes []byte) interface{}
    MakeSlice(capacity int) interface{}
    AppendToSlice(slice interface{}, object interface{}) (sliceNew interface{})
    GeneratorVersion() int
}

An ObjectBinding provides an interface for various object types to be included in the model

type ObjectBox Uses

type ObjectBox struct {
    // contains filtered or unexported fields
}

func (*ObjectBox) AwaitAsyncCompletion Uses

func (ob *ObjectBox) AwaitAsyncCompletion() *ObjectBox

AwaitAsyncCompletion blocks until all PutAsync insert have been processed

func (*ObjectBox) Close Uses

func (ob *ObjectBox) Close()

Close fully closes the database and free's resources

func (*ObjectBox) InternalBox Uses

func (ob *ObjectBox) InternalBox(typeId TypeId) *Box

panics on error (in case entity with the given ID doesn't exist)

func (*ObjectBox) InternalNewQueryBuilder Uses

func (ob *ObjectBox) InternalNewQueryBuilder(typeId TypeId) *QueryBuilder

func (*ObjectBox) SetDebugFlags Uses

func (ob *ObjectBox) SetDebugFlags(flags uint) error

SetDebugFlags configures debug logging of the ObjectBox core. See DebugFlags_* constants

type Property Uses

type Property struct {
    Id     TypeId
    Entity *Entity
}

type PropertyBool Uses

type PropertyBool struct {
    *Property
}

func (PropertyBool) Equals Uses

func (property PropertyBool) Equals(value bool) Condition

type PropertyByte Uses

type PropertyByte struct {
    *Property
}

func (PropertyByte) Between Uses

func (property PropertyByte) Between(a, b byte) Condition

func (PropertyByte) Equals Uses

func (property PropertyByte) Equals(value byte) Condition

func (PropertyByte) GreaterThan Uses

func (property PropertyByte) GreaterThan(value byte) Condition

func (PropertyByte) LessThan Uses

func (property PropertyByte) LessThan(value byte) Condition

func (PropertyByte) NotEquals Uses

func (property PropertyByte) NotEquals(value byte) Condition

type PropertyByteVector Uses

type PropertyByteVector struct {
    *Property
}

func (PropertyByteVector) Equals Uses

func (property PropertyByteVector) Equals(value []byte) Condition

func (PropertyByteVector) GreaterOrEqual Uses

func (property PropertyByteVector) GreaterOrEqual(value []byte) Condition

func (PropertyByteVector) GreaterThan Uses

func (property PropertyByteVector) GreaterThan(value []byte) Condition

func (PropertyByteVector) LessOrEqual Uses

func (property PropertyByteVector) LessOrEqual(value []byte) Condition

func (PropertyByteVector) LessThan Uses

func (property PropertyByteVector) LessThan(value []byte) Condition

type PropertyFloat32 Uses

type PropertyFloat32 struct {
    *Property
}

func (PropertyFloat32) Between Uses

func (property PropertyFloat32) Between(a, b float32) Condition

func (PropertyFloat32) GreaterThan Uses

func (property PropertyFloat32) GreaterThan(value float32) Condition

func (PropertyFloat32) LessThan Uses

func (property PropertyFloat32) LessThan(value float32) Condition

type PropertyFloat64 Uses

type PropertyFloat64 struct {
    *Property
}

func (PropertyFloat64) Between Uses

func (property PropertyFloat64) Between(a, b float64) Condition

func (PropertyFloat64) GreaterThan Uses

func (property PropertyFloat64) GreaterThan(value float64) Condition

func (PropertyFloat64) LessThan Uses

func (property PropertyFloat64) LessThan(value float64) Condition

type PropertyInt Uses

type PropertyInt struct {
    *Property
}

func (PropertyInt) Between Uses

func (property PropertyInt) Between(a, b int) Condition

func (PropertyInt) Equals Uses

func (property PropertyInt) Equals(value int) Condition

func (PropertyInt) GreaterThan Uses

func (property PropertyInt) GreaterThan(value int) Condition

func (PropertyInt) In Uses

func (property PropertyInt) In(values ...int) Condition

func (PropertyInt) LessThan Uses

func (property PropertyInt) LessThan(value int) Condition

func (PropertyInt) NotEquals Uses

func (property PropertyInt) NotEquals(value int) Condition

func (PropertyInt) NotIn Uses

func (property PropertyInt) NotIn(values ...int) Condition

type PropertyInt16 Uses

type PropertyInt16 struct {
    *Property
}

func (PropertyInt16) Between Uses

func (property PropertyInt16) Between(a, b int16) Condition

func (PropertyInt16) Equals Uses

func (property PropertyInt16) Equals(value int16) Condition

func (PropertyInt16) GreaterThan Uses

func (property PropertyInt16) GreaterThan(value int16) Condition

func (PropertyInt16) LessThan Uses

func (property PropertyInt16) LessThan(value int16) Condition

func (PropertyInt16) NotEquals Uses

func (property PropertyInt16) NotEquals(value int16) Condition

type PropertyInt32 Uses

type PropertyInt32 struct {
    *Property
}

func (PropertyInt32) Between Uses

func (property PropertyInt32) Between(a, b int32) Condition

func (PropertyInt32) Equals Uses

func (property PropertyInt32) Equals(value int32) Condition

func (PropertyInt32) GreaterThan Uses

func (property PropertyInt32) GreaterThan(value int32) Condition

func (PropertyInt32) In Uses

func (property PropertyInt32) In(values ...int32) Condition

func (PropertyInt32) LessThan Uses

func (property PropertyInt32) LessThan(value int32) Condition

func (PropertyInt32) NotEquals Uses

func (property PropertyInt32) NotEquals(value int32) Condition

func (PropertyInt32) NotIn Uses

func (property PropertyInt32) NotIn(values ...int32) Condition

type PropertyInt64 Uses

type PropertyInt64 struct {
    *Property
}

func (PropertyInt64) Between Uses

func (property PropertyInt64) Between(a, b int64) Condition

func (PropertyInt64) Equals Uses

func (property PropertyInt64) Equals(value int64) Condition

func (PropertyInt64) GreaterThan Uses

func (property PropertyInt64) GreaterThan(value int64) Condition

func (PropertyInt64) In Uses

func (property PropertyInt64) In(values ...int64) Condition

func (PropertyInt64) LessThan Uses

func (property PropertyInt64) LessThan(value int64) Condition

func (PropertyInt64) NotEquals Uses

func (property PropertyInt64) NotEquals(value int64) Condition

func (PropertyInt64) NotIn Uses

func (property PropertyInt64) NotIn(values ...int64) Condition

type PropertyInt8 Uses

type PropertyInt8 struct {
    *Property
}

func (PropertyInt8) Between Uses

func (property PropertyInt8) Between(a, b int8) Condition

func (PropertyInt8) Equals Uses

func (property PropertyInt8) Equals(value int8) Condition

func (PropertyInt8) GreaterThan Uses

func (property PropertyInt8) GreaterThan(value int8) Condition

func (PropertyInt8) LessThan Uses

func (property PropertyInt8) LessThan(value int8) Condition

func (PropertyInt8) NotEquals Uses

func (property PropertyInt8) NotEquals(value int8) Condition

type PropertyRune Uses

type PropertyRune struct {
    *Property
}

func (PropertyRune) Between Uses

func (property PropertyRune) Between(a, b rune) Condition

func (PropertyRune) Equals Uses

func (property PropertyRune) Equals(value rune) Condition

func (PropertyRune) GreaterThan Uses

func (property PropertyRune) GreaterThan(value rune) Condition

func (PropertyRune) In Uses

func (property PropertyRune) In(values ...rune) Condition

func (PropertyRune) LessThan Uses

func (property PropertyRune) LessThan(value rune) Condition

func (PropertyRune) NotEquals Uses

func (property PropertyRune) NotEquals(value rune) Condition

func (PropertyRune) NotIn Uses

func (property PropertyRune) NotIn(values ...rune) Condition

type PropertyString Uses

type PropertyString struct {
    *Property
}

func (PropertyString) Contains Uses

func (property PropertyString) Contains(text string, caseSensitive bool) Condition

func (PropertyString) Equals Uses

func (property PropertyString) Equals(text string, caseSensitive bool) Condition

func (PropertyString) GreaterOrEqual Uses

func (property PropertyString) GreaterOrEqual(text string, caseSensitive bool) Condition

func (PropertyString) GreaterThan Uses

func (property PropertyString) GreaterThan(text string, caseSensitive bool) Condition

func (PropertyString) HasPrefix Uses

func (property PropertyString) HasPrefix(text string, caseSensitive bool) Condition

func (PropertyString) HasSuffix Uses

func (property PropertyString) HasSuffix(text string, caseSensitive bool) Condition

func (PropertyString) In Uses

func (property PropertyString) In(caseSensitive bool, texts ...string) Condition

func (PropertyString) LessOrEqual Uses

func (property PropertyString) LessOrEqual(text string, caseSensitive bool) Condition

func (PropertyString) LessThan Uses

func (property PropertyString) LessThan(text string, caseSensitive bool) Condition

func (PropertyString) NotEquals Uses

func (property PropertyString) NotEquals(text string, caseSensitive bool) Condition

type PropertyUint Uses

type PropertyUint struct {
    *Property
}

func (PropertyUint) Equals Uses

func (property PropertyUint) Equals(value uint) Condition

func (PropertyUint) In Uses

func (property PropertyUint) In(values ...uint) Condition

func (PropertyUint) NotEquals Uses

func (property PropertyUint) NotEquals(value uint) Condition

func (PropertyUint) NotIn Uses

func (property PropertyUint) NotIn(values ...uint) Condition

type PropertyUint16 Uses

type PropertyUint16 struct {
    *Property
}

func (PropertyUint16) Between Uses

func (property PropertyUint16) Between(a, b uint16) Condition

func (PropertyUint16) Equals Uses

func (property PropertyUint16) Equals(value uint16) Condition

func (PropertyUint16) GreaterThan Uses

func (property PropertyUint16) GreaterThan(value uint16) Condition

func (PropertyUint16) LessThan Uses

func (property PropertyUint16) LessThan(value uint16) Condition

func (PropertyUint16) NotEquals Uses

func (property PropertyUint16) NotEquals(value uint16) Condition

type PropertyUint32 Uses

type PropertyUint32 struct {
    *Property
}

func (PropertyUint32) Between Uses

func (property PropertyUint32) Between(a, b uint32) Condition

func (PropertyUint32) Equals Uses

func (property PropertyUint32) Equals(value uint32) Condition

func (PropertyUint32) GreaterThan Uses

func (property PropertyUint32) GreaterThan(value uint32) Condition

func (PropertyUint32) In Uses

func (property PropertyUint32) In(values ...uint32) Condition

func (PropertyUint32) LessThan Uses

func (property PropertyUint32) LessThan(value uint32) Condition

func (PropertyUint32) NotEquals Uses

func (property PropertyUint32) NotEquals(value uint32) Condition

func (PropertyUint32) NotIn Uses

func (property PropertyUint32) NotIn(values ...uint32) Condition

type PropertyUint64 Uses

type PropertyUint64 struct {
    *Property
}

func (PropertyUint64) Equals Uses

func (property PropertyUint64) Equals(value uint64) Condition

func (PropertyUint64) In Uses

func (property PropertyUint64) In(values ...uint64) Condition

func (PropertyUint64) NotEquals Uses

func (property PropertyUint64) NotEquals(value uint64) Condition

func (PropertyUint64) NotIn Uses

func (property PropertyUint64) NotIn(values ...uint64) Condition

type PropertyUint8 Uses

type PropertyUint8 struct {
    *Property
}

func (PropertyUint8) Between Uses

func (property PropertyUint8) Between(a, b uint8) Condition

func (PropertyUint8) Equals Uses

func (property PropertyUint8) Equals(value uint8) Condition

func (PropertyUint8) GreaterThan Uses

func (property PropertyUint8) GreaterThan(value uint8) Condition

func (PropertyUint8) LessThan Uses

func (property PropertyUint8) LessThan(value uint8) Condition

func (PropertyUint8) NotEquals Uses

func (property PropertyUint8) NotEquals(value uint8) Condition

type Query Uses

type Query struct {
    // contains filtered or unexported fields
}

A Query allows to search for objects matching user defined conditions.

For example, you can find all people whose last name starts with an 'N':

box.Query(Person_.LastName.HasPrefix("N", false)).Find()

Note that Person_ is a struct generated by ObjectBox allowing to conveniently reference properties.

func (*Query) Close Uses

func (query *Query) Close() error

Frees (native) resources held by this Query. Note that this is optional and not required because the GC invokes a finalizer automatically.

func (*Query) Count Uses

func (query *Query) Count() (count uint64, err error)

Count returns the number of objects matching the query

func (*Query) Describe Uses

func (query *Query) Describe() (string, error)

Describe returns a string representation of the query

func (*Query) Find Uses

func (query *Query) Find() (objects interface{}, err error)

Find returns all objects matching the query

func (*Query) FindIds Uses

func (query *Query) FindIds() (ids []uint64, err error)

FindIds returns IDs of all objects matching the query

func (*Query) InternalSetParamInt Uses

func (query *Query) InternalSetParamInt(propertyId TypeId, value int64) (err error)

Internal & temporary API

func (*Query) InternalSetParamString Uses

func (query *Query) InternalSetParamString(propertyId TypeId, value string) (err error)

Internal & temporary API

func (*Query) Remove Uses

func (query *Query) Remove() (count uint64, err error)

Remove permanently deletes all objects matching the query from the database

type QueryBuilder Uses

type QueryBuilder struct {

    // The first error that occurred during a any of the calls on the query builder
    Err error
    // contains filtered or unexported fields
}

Internal class; use Box.Query instead. Allows construction of queries; just check queryBuilder.Error or err from Build()

func (*QueryBuilder) Build Uses

func (qb *QueryBuilder) Build() (*Query, error)

func (*QueryBuilder) BuildWithConditions Uses

func (qb *QueryBuilder) BuildWithConditions(conditions ...Condition) (*Query, error)

func (*QueryBuilder) BytesEqual Uses

func (qb *QueryBuilder) BytesEqual(propertyId TypeId, value []byte) (ConditionId, error)

func (*QueryBuilder) BytesGreater Uses

func (qb *QueryBuilder) BytesGreater(propertyId TypeId, value []byte, withEqual bool) (ConditionId, error)

func (*QueryBuilder) BytesLess Uses

func (qb *QueryBuilder) BytesLess(propertyId TypeId, value []byte, withEqual bool) (ConditionId, error)

func (*QueryBuilder) Close Uses

func (qb *QueryBuilder) Close() error

func (*QueryBuilder) DoubleBetween Uses

func (qb *QueryBuilder) DoubleBetween(propertyId TypeId, valueA float64, valueB float64) (ConditionId, error)

func (*QueryBuilder) DoubleGreater Uses

func (qb *QueryBuilder) DoubleGreater(propertyId TypeId, value float64) (ConditionId, error)

func (*QueryBuilder) DoubleLess Uses

func (qb *QueryBuilder) DoubleLess(propertyId TypeId, value float64) (ConditionId, error)

func (*QueryBuilder) Int32In Uses

func (qb *QueryBuilder) Int32In(propertyId TypeId, values []int32) (ConditionId, error)

func (*QueryBuilder) Int32NotIn Uses

func (qb *QueryBuilder) Int32NotIn(propertyId TypeId, values []int32) (ConditionId, error)

func (*QueryBuilder) Int64In Uses

func (qb *QueryBuilder) Int64In(propertyId TypeId, values []int64) (ConditionId, error)

func (*QueryBuilder) Int64NotIn Uses

func (qb *QueryBuilder) Int64NotIn(propertyId TypeId, values []int64) (ConditionId, error)

func (*QueryBuilder) IntBetween Uses

func (qb *QueryBuilder) IntBetween(propertyId TypeId, value1 int64, value2 int64) (ConditionId, error)

func (*QueryBuilder) IntEqual Uses

func (qb *QueryBuilder) IntEqual(propertyId TypeId, value int64) (ConditionId, error)

func (*QueryBuilder) IntGreater Uses

func (qb *QueryBuilder) IntGreater(propertyId TypeId, value int64) (ConditionId, error)

obx_qb_cond obx_qb_int_greater(OBX_query_builder* builder, obx_schema_id property_id, int64 value);

func (*QueryBuilder) IntLess Uses

func (qb *QueryBuilder) IntLess(propertyId TypeId, value int64) (ConditionId, error)

obx_qb_cond obx_qb_int_less(OBX_query_builder* builder, obx_schema_id property_id, int64 value);

func (*QueryBuilder) IntNotEqual Uses

func (qb *QueryBuilder) IntNotEqual(propertyId TypeId, value int64) (ConditionId, error)

obx_qb_cond obx_qb_int_not_equal(OBX_query_builder* builder, obx_schema_id property_id, int64 value);

func (*QueryBuilder) NotNull Uses

func (qb *QueryBuilder) NotNull(propertyId TypeId) (ConditionId, error)

func (*QueryBuilder) Null Uses

func (qb *QueryBuilder) Null(propertyId TypeId) (ConditionId, error)

func (*QueryBuilder) StringContains Uses

func (qb *QueryBuilder) StringContains(propertyId TypeId, value string, caseSensitive bool) (ConditionId, error)

func (*QueryBuilder) StringEquals Uses

func (qb *QueryBuilder) StringEquals(propertyId TypeId, value string, caseSensitive bool) (ConditionId, error)

func (*QueryBuilder) StringGreater Uses

func (qb *QueryBuilder) StringGreater(propertyId TypeId, value string, caseSensitive bool, withEqual bool) (ConditionId, error)

func (*QueryBuilder) StringHasPrefix Uses

func (qb *QueryBuilder) StringHasPrefix(propertyId TypeId, value string, caseSensitive bool) (ConditionId, error)

func (*QueryBuilder) StringHasSuffix Uses

func (qb *QueryBuilder) StringHasSuffix(propertyId TypeId, value string, caseSensitive bool) (ConditionId, error)

func (*QueryBuilder) StringIn Uses

func (qb *QueryBuilder) StringIn(propertyId TypeId, values []string, caseSensitive bool) (ConditionId, error)

func (*QueryBuilder) StringLess Uses

func (qb *QueryBuilder) StringLess(propertyId TypeId, value string, caseSensitive bool, withEqual bool) (ConditionId, error)

func (*QueryBuilder) StringNotEquals Uses

func (qb *QueryBuilder) StringNotEquals(propertyId TypeId, value string, caseSensitive bool) (ConditionId, error)

type Transaction Uses

type Transaction struct {
    // contains filtered or unexported fields
}

Internal: won't be publicly exposed in a future version!

func (*Transaction) Abort Uses

func (txn *Transaction) Abort() error

func (*Transaction) Close Uses

func (txn *Transaction) Close() error

func (*Transaction) Commit Uses

func (txn *Transaction) Commit() error

func (*Transaction) CursorForName Uses

func (txn *Transaction) CursorForName(entitySchemaName string) (*cursor, error)

Internal: won't be available in future versions

type TypeId Uses

type TypeId uint32

type Version Uses

type Version struct {
    Major int
    Minor int
    Patch int
}

If you depend on a certain version of ObjectBox, you can check using this struct. See also VersionGo() and VersionLib().

func VersionGo Uses

func VersionGo() Version

ObjectBox Version Go

func VersionLib Uses

func VersionLib() Version

Version of the dynamic linked ObjectBox library

func (Version) String Uses

func (v Version) String() string

Directories

PathSynopsis
fbutilsPackage fbutils provides utilities for the FlatBuffers in ObjectBox

Package objectbox imports 11 packages (graph). Updated 2018-12-06. Refresh now. Tools for package owners.