Popularity
2.6
Declining
Activity
0.0
Declining
26
1
8
Programming language: Go
License: Mozilla Public License 2.0
Tags:
Database
go-fixtures alternatives and similar packages
Based on the "Database" category.
Alternatively, view go-fixtures 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
Scout APM uses tracing logic that ties bottlenecks to source code so you know the exact line of code causing performance issues and can get back to building a great product faster.
Sponsored
scoutapm.com
Do you think we are missing an alternative of go-fixtures or a related project?
README
go-fixtures
Django style fixtures for Golang's excellent built-in database/sql
library. Currently only YAML
fixtures are supported.
There are two reserved values you can use for datetime
fields:
ON_INSERT_NOW()
will only be used when a row is being insertedON_UPDATE_NOW()
will only be used when a row is being updated
Example YAML fixture:
---
- table: 'some_table'
pk:
id: 1
fields:
string_field: 'foobar'
boolean_field: true
created_at: 'ON_INSERT_NOW()'
updated_at: 'ON_UPDATE_NOW()'
- table: 'other_table'
pk:
id: 2
fields:
int_field: 123
boolean_field: false
created_at: 'ON_INSERT_NOW()'
updated_at: 'ON_UPDATE_NOW()'
- table: 'join_table'
pk:
some_id: 1
other_id: 2
Example integration for your project:
package main
import (
"database/sql"
"io/ioutil"
"log"
"github.com/RichardKnop/go-fixtures"
"github.com/urfave/cli"
// Drivers
_ "github.com/lib/pq"
)
var (
cliApp *cli.App
)
func init() {
cliApp = cli.NewApp()
cliApp.Name = "your-project"
cliApp.Usage = "Project's usage"
cliApp.Author = "Your Name"
cliApp.Email = "[email protected]"
cliApp.Version = "0.0.0"
}
func main() {
db, err := sql.Connect("postgres", "user=foo dbname=bar sslmode=disable")
if err != nil {
log.Fatal(err)
}
defer db.Close()
cliApp.Commands = []cli.Command{
{
Name: "loaddata",
Usage: "load data from fixture",
Action: func(c *cli.Context) error {
data, err := ioutil.ReadFile(c.Args().First())
if err != nil {
return err
}
if err := fixtures.Load(data, db, "postgres"); err != nil {
return err
}
},
},
{
Name: "runserver",
Usage: "run web server",
Action: func(c *cli.Context) error {
// Run your web server here
return nil
},
},
}
cliApp.Run(os.Args)
}