gondolier alternatives and similar packages
Based on the "Database" category.
Alternatively, view gondolier alternatives based on common mentions on social networks and blogs.
-
tidb
TiDB is a distributed SQL database. Inspired by the design of Google F1. -
influxdb
Scalable datastore for metrics, events, and real-time analytics -
dgraph
Scalable, Distributed, Low Latency, High Throughput Graph Database. -
vitess
vitess provides servers and tools which facilitate scaling of MySQL databases for large scale web services. -
groupcache
Groupcache is a caching and cache-filling library, intended as a replacement for memcached in many cases. -
rqlite
The lightweight, distributed, relational database built on SQLite. -
TinyGo
Go compiler for small places. Microcontrollers, WebAssembly, and command-line tools. Based on LLVM. -
migrate
Database migration handling in Golang support MySQL,PostgreSQL,Cassandra and SQLite. -
kingshard
kingshard is a high performance proxy for MySQL powered by Golang. -
goleveldb
An implementation of the LevelDB key/value database in the Go. -
go-cache
An in-memory key:value store/cache (similar to Memcached) library for Go, suitable for single-machine applications. -
go-mysql-elasticsearch
Sync your MySQL data into Elasticsearch automatically. -
ledisdb
Ledisdb is a high performance NoSQL like Redis based on LevelDB. -
VictoriaMetrics
fast, resource-effective and scalable open source time series database. May be used as long-term remote storage for Prometheus. Supports PromQL. -
buntdb
A fast, embeddable, in-memory key/value database for Go with custom indexing and spatial support. -
xo
Generate idiomatic Go code for databases based on existing schema definitions or custom queries supporting PostgreSQL, MySQL, SQLite, Oracle, and Microsoft SQL Server. -
sql-migrate
Database migration tool. Allows embedding migrations into the application using go-bindata. -
cache2go
An in-memory key:value cache which supports automatic invalidation based on timeouts. -
immudb
immudb is a lightweight, high-speed immutable database for systems and applications written in Go. -
GCache
Cache library with support for expirable Cache, LFU, LRU and ARC. -
nutsdb
Nutsdb is a simple, fast, embeddable, persistent key/value store written in pure Go. It supports fully serializable transactions and many data structures such as list, set, sorted set. -
fastcache
fast thread-safe inmemory cache for big number of entries. Minimizes GC overhead. -
skeema
Pure-SQL schema management system for MySQL, with support for sharding and external online schema change tools. -
Bitcask
Bitcask is an embeddable, persistent and fast key-value (KV) database written in pure Go with predictable read/write performance, low latency and high throughput thanks to the bitcask on-disk layout (LSM+WAL). -
Databunker
Personally identifiable information (PII) storage service built to comply with GDPR and CCPA.
Scout APM - Leading-edge performance monitoring starting at $39/month
Do you think we are missing an alternative of gondolier or a related project?
Popular Comparisons
README
Gondolier
Description
Gondolier is a library to auto migrate database schemas in Go (golang) using structs. Quick demo:
type Customer struct {
Id uint64 `gondolier:"type:bigint;id"`
Name string `gondolier:"type:varchar(255);notnull"`
Age int `gondolier:"type:integer;notnull"`
}
type Order struct {
Id uint64 `gondolier:"type:bigint;id"`
Buyer uint64 `gondolier:"type:bigint;fk:customer.id;notnull"`
}
type OrderPosition struct {
Id uint64 `gondolier:"type:bigint;id"`
Order uint64 `gondolier:"type:bigint;fk:order.id;notnull"`
Quantity int `gondolier:"type:integer;notnull"`
Cost int `gondolier:"type:integer;notnull"`
}
type Obsolete struct{}
func main() {
// connect to database
db, _ := sql.Open("postgres", dbString())
defer db.Close()
// migrate your schema
gondolier.Use(db, &gondolier.Postgres{Schema: "public",
DropColumns: true,
Log: true})
gondolier.Model(Customer{}, Order{}, OrderPosition{})
gondolier.Drop(Obsolete{})
gondolier.Migrate()
}
Features
- create and update your database schema just from your data model defined in Go
- drop columns when they're no longer needed (removed in struct)
- drop tables by passing a struct (which can be empty)
Supported databases
- Postgres
Limits
- no multi primary key support yet
- there is no way Gondolier can check if the data model is valid, so it might fail to execute the migration (with a panic)
Installation
To install Gondolier, go get all dependencies and Gondolier:
go get github.com/lib/pq # for Postgres
go get github.com/emvi/gondolier
Usage
Gondolier consists only out of a few methods. First, you set up Gondolier by passing the database connection and the migrator to Use:
gondolier.Use(dbconn, migrator)
The migrator is an interface which is used by Gondolier to migrate the data model. Example:
gondolier.Postgres{Schema: "public", DropColums: true, Log: true}
This will configure the Postgres migrator to use the schema "public", drop columns when the field is missing in the data model and output executed SQL statements to log (using the standard log library).
Now you can define a naming schema used to name tables and columns:
gondolier.Naming(&gondolier.SnakeCase{})
You can define your own naming schema by implementing the NameSchema interface. Currently SnakeCase is the default. You don't need to call Naming to set it.
Now call Model and pass the models which define your database schema:
gondolier.Model(MyModel{}, &AnotherModel{})
Model accepts objects and pointers. The models must define a decorator with meta information. For more details take a look at the Postgres Migrator or the example implementation. Here is a short example:
type MyModel struct {
Id uint64 `gondolier:"type:bigint;id"` // id is a shortcut
SomeAttr string `gondolier:"type:text;notnull"`
}
type AnotherModel struct {
Id uint64 `gondolier:"type:bigint;pk;seq:1,1,-,-,1;default:nextval(seq);notnull"` // long version for "id"
UniqueAttr int `gondolier:"type:integer;notnull;unique;default:42"`
AnArray []string `gondolier:"type:varchar(100)[]"`
ForeignKey uint64 `gondolier:"type:bigint;fk:MyModel.Id;notnull"`
}
Afterwards, call Migrate to start the migration:
gondolier.Migrate()
To drop a table that is no longer needed, call Drop. You can remove all attributes from the struct, only the name must match the old struct:
type DropMe struct {}
gondolier.Drop(DropMe{})
Contribute
[See CONTRIBUTING.md](CONTRIBUTING.md)
License
MIT
*Note that all licence references and agreements mentioned in the gondolier README section above
are relevant to that project's source code only.