objectbox-go

module
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2018 License: Apache-2.0

README

ObjectBox Go API

ObjectBox is a superfast database for objects. Using this Golang API, you can us ObjectBox as an embedded database in your Go application. In this embedded mode, it runs within your application process.

Some features

  • Object storage based on FlatBuffers
  • Secondary indexes based on object properties
  • Simple CRUD API
  • Asynchronous puts
  • Automatic model migration (no schema upgrade scripts etc.)
  • (Coming soon: Powerful queries)
  • (Coming soon: Relations to other objects)

Installation

To get started with ObjectBox you can get the repository code as usual with go get and install the two prerequisites - pre-compiled library and a bindings generator.

go get github.com/objectbox/objectbox-go
go get github.com/google/flatbuffers/go

mkdir objectboxlib && cd objectboxlib
curl https://raw.githubusercontent.com/objectbox/objectbox-c/master/download.sh > download.sh
bash download.sh

go install github.com/objectbox/objectbox-go/cmd/objectbox-gogen/

See installation docs for more details and further instructions.

Additionally, you can run tests to validate your installation

go test github.com/objectbox/objectbox-go/...

Docs

Documentation is still on-going work. To get started, please have a look at the examples directory and golang.objectbox.io.

Current state

As this is still an early version of the Go APIs, they are not as convenient as the Java/Kotlin APIs, which deeply integrate into the language using e.g. @Entity annotations.

A better language integration could be build based on reflection, code generation, or a combination of both.

License

Copyright 2018 ObjectBox Ltd. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Directories

Path Synopsis
cmd
objectbox-gogen
Generates objectbox related code for ObjectBox entities (Go structs) It can be used by adding `//go:generate objectbox-gogen` comment inside a .go file containing the struct that you want to persist and executing `go generate` in the module Alternatively, you can run the command manually: objectbox-gogen [flags] The flags are -persist string path to the model information persistence file -source string path to the source file containing structs to process To learn more about different configuration and annotations for entities, see docs at https://golang.objectbox.io/
Generates objectbox related code for ObjectBox entities (Go structs) It can be used by adding `//go:generate objectbox-gogen` comment inside a .go file containing the struct that you want to persist and executing `go generate` in the module Alternatively, you can run the command manually: objectbox-gogen [flags] The flags are -persist string path to the model information persistence file -source string path to the source file containing structs to process To learn more about different configuration and annotations for entities, see docs at https://golang.objectbox.io/
examples
internal
generator
Package generator provides tools to generate ObjectBox entity bindings between GO structs & ObjectBox schema
Package generator provides tools to generate ObjectBox entity bindings between GO structs & ObjectBox schema
Package objectbox provides a super-fast, light-weight object persistence framework.
Package objectbox provides a super-fast, light-weight object persistence framework.
fbutils
Package fbutils provides utilities for the FlatBuffers in ObjectBox
Package fbutils provides utilities for the FlatBuffers in ObjectBox
test

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL