prep alternatives and similar packages
Based on the "Database" category.
Alternatively, view prep alternatives based on common mentions on social networks and blogs.
-
cockroach
CockroachDB - the open source, cloud-native distributed SQL database. -
tidb
TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://tidbcloud.com/free-trial -
Milvus
A cloud-native vector database, storage for next generation AI applications -
vitess
Vitess is a database clustering system for horizontal scaling of MySQL. -
groupcache
groupcache is a caching and cache-filling library, intended as a replacement for memcached in many cases. -
TinyGo
Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM. -
VictoriaMetrics
VictoriaMetrics: fast, cost-effective monitoring solution and time series database -
immudb
immudb - immutable database based on zero trust, SQL/Key-Value/Document model, tamperproof, data change history -
go-cache
An in-memory key:value store/cache (similar to Memcached) library for Go, suitable for single-machine applications. -
bytebase
Database DevOps and CI/CD for Developer, DBA and Platform Engineering team. -
rosedb
Lightweight, fast and reliable key/value storage engine based on Bitcask. -
pREST
PostgreSQL ➕ REST, low-code, simplify and accelerate development, ⚡ instant, realtime, high-performance on any Postgres application, existing or new -
buntdb
BuntDB is an embeddable, in-memory key/value database for Go with custom indexing and geospatial support -
xo
Command line tool to generate idiomatic Go code for SQL databases supporting PostgreSQL, MySQL, SQLite, Oracle, and Microsoft SQL Server -
tiedot
A rudimentary implementation of a basic document (NoSQL) database in Go -
nutsdb
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. -
LinDB
LinDB is a scalable, high performance, high availability distributed time series database. -
cache2go
Concurrency-safe Go caching library with expiration capabilities and access counters -
GCache
An in-memory cache library for golang. It supports multiple eviction policies: LRU, LFU, ARC -
fastcache
Fast thread-safe inmemory cache for big number of entries in Go. Minimizes GC overhead -
gocraft/dbr (database records)
Additions to Go's database/sql for super fast performance and convenience. -
CovenantSQL
A decentralized, trusted, high performance, SQL database with blockchain features -
lotusdb
Most advanced key-value store written in Go, extremely fast, compatible with LSM tree and B+ tree, optimization of badger and bbolt.
Collect and Analyze Billions of Data Points in Real Time
Do you think we are missing an alternative of prep or a related project?
Popular Comparisons
README
Prep

Prep finds all SQL statements in a Go package and instruments db connection with prepared statements. It allows you to benefit from the prepared SQL statements almost without any changes to your code.
Prep consists of two parts:
- A command line tool that finds all SQL statements in your code
- A package that instruments your code with prepared SQL statements using the found ones
Usage
Generate a list of SQL statements used in your application
$ cat example.go
func main() {
db, err := sql.Open("mysql", "user:pass@tcp(localhost:3306)/mysql")
if err != nil {
panic(err)
}
const query = `SELECT CONCAT("Hello ", ?, "!")`
var s string
if err := db.QueryRow(query, "World").Scan(&s); err != nil {
panic(err)
}
fmt.Println(s)
}
Let's generate a list of the SQL statements used in your package:
$ prep -f github.com/hexdigest/prepdemo
$ cat prepared_statements.go
//go:generate prep -f github.com/hexdigest/prepdemo
package main
var prepStatements = []string{
"SELECT CONCAT(\"Hello \", ?, \"!\")",
}
Using prepared statements
func main() {
sqlDB, err := sql.Open("mysql", "root:root@tcp(localhost:3306)/mysql")
if err != nil {
panic(err)
}
db, err := prep.NewConnection(sqlDB, prepStatements)
if err != nil {
panic(err)
}
const query = `SELECT CONCAT("Hello ", ?, "!")`
var s string
if err := db.QueryRow(query, "World").Scan(&s); err != nil {
panic(err)
}
fmt.Println(s)
}
Take a look at the line:
db, err := prep.NewConnection(sqlDB, prepStatements)
It instruments your connection with prepared statements found by the generator. The generated code already contains //go:generate instruction, so in order to update the statements list you can simply run:
$ go generate
Some synthetic benchmarks
$ go test -bench=.
BenchmarkPostgresWithoutPreparedStatements-4 20000 59941 ns/op 1183 B/op 32 allocs/op
BenchmarkPostgresWithPreparedStatements-4 50000 41560 ns/op 1021 B/op 26 allocs/op
BenchmarkMySQLWithoutPreparedStatements-4 50000 26454 ns/op 827 B/op 23 allocs/op
BenchmarkMySQLWithPreparedStatements-4 200000 9509 ns/op 634 B/op 19 allocs/op
PASS
ok github.com/hexdigest/prep 7.884s
*Note that all licence references and agreements mentioned in the prep README section above
are relevant to that project's source code only.