Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/objectbox/objectbox-go
Embedded Go Database, the fast alternative to SQLite, gorm, etc.
https://github.com/objectbox/objectbox-go
database edge embedded go golang iot nosql offline-first storage
Last synced: 7 days ago
JSON representation
Embedded Go Database, the fast alternative to SQLite, gorm, etc.
- Host: GitHub
- URL: https://github.com/objectbox/objectbox-go
- Owner: objectbox
- License: apache-2.0
- Created: 2018-11-28T13:32:47.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2024-08-29T11:45:57.000Z (3 months ago)
- Last Synced: 2024-11-28T09:03:12.353Z (14 days ago)
- Topics: database, edge, embedded, go, golang, iot, nosql, offline-first, storage
- Language: Go
- Homepage: https://objectbox.io
- Size: 2.35 MB
- Stars: 1,106
- Watchers: 20
- Forks: 46
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-go - objectbox-go - High-performance embedded Object Database (NoSQL) with Go API. (Database / Databases Implemented in Go)
- awesome-go - objectbox-go - High-performance embedded Object Database (NoSQL) with Go API. Stars:`1.1K`. (Database / Databases Implemented in Go)
- awesome-golang-repositories - objectbox-go - of-the-box Data Sync (Repositories)
- awesome-go-storage - objectbox-go - Embedded Object Database (NoSQL) with Go API. (Database)
README
Getting Started โข
Documentation โข
Example Apps โข
IssuesObjectBox Go Database - simple but powerful; frugal but fast
=========================
The Golang database is easy to use via an intuitive native Golang API and persists objects superfast and sustainably.\
Go and check out [the performance benchmarks vs SQLite (GORM) & Storm](https://objectbox.io/go-1-0-release-and-performance-benchmarks/).ObjectBox persists your native Go structs using a simple CRUD API:
```go
id, err := box.Put(&Person{ FirstName: "Joe", LastName: "Green" })
```Want details? **[Read the docs](https://golang.objectbox.io/)** or
**[check out the API reference](https://godoc.org/github.com/objectbox/objectbox-go/objectbox)**.Latest release: [v1.8.1 (2024-08-29)](https://golang.objectbox.io/)
## Table of Contents:
- [High-performance Golang database](#high-performance-golang-database)
- [Getting started](#getting-started)
- [Already using ObjectBox?](#already-using-objectbox)
- [Upgrading to a newer version](#upgrading-to-a-newer-version)
- [Other languages/bindings](#other-languagesbindings)
- [License](#license)High-performance Go database
--------------------------------
๐ **High performance** on restricted devices, like IoT gateways, micro controllers, ECUs etc.\
๐ **Resourceful** with minimal CPU, power and Memory usage for maximum flexibility and sustainability\
๐ **Relations:** object links / relationships are built-in\
๐ป **Multiplatform:** Linux, Windows, Android, iOS, macOS๐ฑ **Scalable:** handling millions of objects resource-efficiently with ease\
๐ **Queries:** filter data as needed, even across relations\
๐ฆฎ **Statically typed:** compile time checks & optimizations\
๐ **Automatic schema migrations:** no update scripts needed**And much more than just data persistence**\
๐ฅ **[ObjectBox Sync](https://objectbox.io/sync/):** keeps data in sync between devices and servers\
๐ **[ObjectBox TS](https://objectbox.io/time-series-database/):** time series extension for time based dataGetting started: Go!
---------------
To install ObjectBox, execute the following command in your project directory.
You can have a look at [installation docs](https://golang.objectbox.io/install) for more details and further instructions.
```bash
bash <(curl -s https://raw.githubusercontent.com/objectbox/objectbox-go/main/install.sh)
```To install [ObjectBox Sync](https://objectbox.io/sync/) variant of the library, pass `--sync` argument to the command above:
```bash
bash <(curl -s https://raw.githubusercontent.com/objectbox/objectbox-go/main/install.sh) --sync
```You can run tests to validate your installation
```bash
go test github.com/objectbox/objectbox-go/...
```With the dependencies installed, you can start adding entities to your project:
```go
//go:generate go run github.com/objectbox/objectbox-go/cmd/objectbox-gogen
โ
type Task struct {
Id uint64
Text string
}
```
And run code generation in your project dir
```bash
go generate ./...
```
This generates a few files in the same folder as the entity - remember to add those to version control (e. g. git).Once code generation finished successfully, you can start using ObjectBox:
```go
obx := objectbox.NewBuilder().Model(ObjectBoxModel()).Build()
box := BoxForTask(obx) // Generated function to provide a Box for Task objects
id, _ := box.Put(&Task{ Text: "Buy milk" })
```See the [Getting started](https://golang.objectbox.io/getting-started) section of our docs for a more thorough intro.
Also, please have a look at the [examples](examples) directory and for the API reference see
[ObjectBox GoDocs](https://godoc.org/github.com/objectbox/objectbox-go/objectbox) - and the sources in this repo.Already using ObjectBox Database?
---------------------------**Your opinion matters to us!** Please fill in this 2-minute [Anonymous Feedback Form](https://forms.gle/LvVjN6jfFHuivxZX6).
We believe, ObjectBox is super easy to use. We are on a mission to make developersโ lives better, by building developer tools that are intuitive and fun to code with.
To do that, we want your feedback: what do you love? What's amiss? Where do you struggle in everyday app development?**We're looking forward to receiving your comments and requests:**
- Add [GitHub issues](https://github.com/ObjectBox/objectbox-go/issues)
- Upvote issues you find important by hitting the ๐/+1 reaction button
- Drop us a line via [@ObjectBox_io](https://twitter.com/ObjectBox_io/)
- โญ us, if you like what you seeThank you! ๐
Keep in touch: For general news on ObjectBox, [check our blog](https://objectbox.io/blog)!
Upgrading to a newer version
----------------------------
When you want to update, please re-run the entire installation process to ensure all components are updated:* ObjectBox itself (objectbox/objectbox-go)
* Dependencies (flatbuffers)
* ObjectBox library (libobjectbox.so|dylib; objectbox.dll)
* ObjectBox code generatorThis is important as diverging versions of any component might result in errors.
The `install.sh` script can also be used for upgrading:
```bash
bash <(curl -s https://raw.githubusercontent.com/objectbox/objectbox-go/main/install.sh)
```
Afterwards, don't forget to re-run the code generation on your project
```bash
go generate ./...
```Other languages/bindings
------------------------
ObjectBox supports multiple platforms and languages:* [Java/Kotlin Database](https://github.com/objectbox/objectbox-java): runs on Android, desktop, and servers
* [Swift Database](https://github.com/objectbox/objectbox-swift): build fast mobile apps for iOS (and macOS)
* [Dart/Flutter Database](https://github.com/objectbox/objectbox-dart): cross-platform for mobile and desktop apps
* [C and C++ Database](https://github.com/objectbox/objectbox-c): native speed with zero copy access to FlatBuffer objectsLicense
-------
Copyright 2018-2024 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.