Grove is a polyglot Go ORM that generates native query syntax for each database driver. It answers the fundamental question: "How do I access my data with near-raw performance and maximum flexibility?"
Grove supports multiple database backends through dedicated drivers:
PostgreSQL — Native
$1placeholders,DISTINCT ON,FOR UPDATE, JSONB operatorsMySQL — Backtick quoting,
ON DUPLICATE KEY UPDATE,USE INDEXhintsSQLite — Lightweight embedded database with
INSERT OR REPLACEMongoDB — Native BSON filter documents, aggregation pipelines
Key Features01
Native Query Syntax — Each driver generates queries in its database's native idiom
Dual Tag System —
grove:"..."tags withbun:"..."fallback for zero-cost migrationNear-Raw Performance — Zero reflection at query time, pooled buffers, cached metadata
Modular Migrations — Go-code migrations with multi-module dependency ordering
Privacy Hooks — Pre/post query hooks for tenant isolation, PII redaction, and audit logging
Key-Value Store — Command-oriented KV access layer with Redis, Memcached, DynamoDB, BoltDB, and Badger drivers
Forge Integration — First-class Forge extension with DI, migrations, and hook wiring
Quick Example02
// Create and open the driver, then pass it to Grove
pgdb := pgdriver.New()
pgdb.Open(ctx, "postgres://user:pass@localhost/mydb", driver.WithPoolSize(20))
db, _ := grove.Open(pgdb)
// Access the typed PG query builder via Unwrap
pg := pgdriver.Unwrap(db)
var users []User
err := pg.NewSelect(&users).
Where("email ILIKE $1", "%@example.com").
Where("role = $2", "admin").
OrderExpr("created_at DESC").
Limit(50).
Scan(ctx)