-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdoc.go
More file actions
37 lines (37 loc) · 1.32 KB
/
doc.go
File metadata and controls
37 lines (37 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Package grove is a polyglot Go ORM with native query syntax per database.
//
// Grove provides near-raw performance with driver-specific query builders that
// expose each database's native idioms. PostgreSQL queries use $1 placeholders
// and PG-specific features. MySQL queries use ? placeholders and backtick quoting.
// MongoDB queries use native BSON syntax.
//
// # Key Features
//
// - Native query syntax per driver (no unified DSL)
// - Dual tag system: grove:"..." primary, bun:"..." fallback
// - Zero-reflection hot path (reflect once at registration)
// - Modular migrations with multi-module dependency ordering
// - Privacy hooks for tenant isolation, PII redaction, audit logging
// - Part of the Forge ecosystem (github.com/xraph/forge)
//
// # Quick Start
//
// // Define a model
// type User struct {
// grove.BaseModel `grove:"table:users,alias:u"`
//
// ID int64 `grove:"id,pk,autoincrement"`
// Name string `grove:"name,notnull"`
// Email string `grove:"email,notnull,unique"`
// }
//
// // Connect and register
// db, err := grove.Open(pgdriver.New(), "postgres://localhost:5432/mydb")
// db.RegisterModel((*User)(nil))
//
// // Query with native PostgreSQL syntax
// var users []User
// err = db.NewSelect(&users).
// Where("email ILIKE $1", "%@example.com").
// Scan(ctx)
package grove