A lightweight Go library that eliminates database boilerplate. Write real SQL with type safety, cached queries, and zero code generation.
go get github.com/tracewayapp/lit/v2Features
Write actual SQL queries. No DSLs, no query builders, no magic. Full control over every database operation.
INSERT and UPDATE statements are pre-computed at registration. Zero runtime overhead for query generation.
No build steps. No generated files to maintain. Import the library and start building immediately.
Only two dependencies: database/sql and uuid. Small binary footprint and fast compilation times.
Go generics provide compile-time type safety for all your database operations.
Map query results to any struct. Use DTOs for JOINs, aggregations, and projections.
Define a struct. Register it. Query.
type User struct { Id int FirstName string LastName string Email string } func main() { // Register once at startup lit.RegisterModel[User](lit.PostgreSQL) db, _ := sql.Open("postgres", connStr) // Create id, _ := lit.Insert(db, &user) // Read users, _ := lit.Select[User](db, "SELECT * FROM users") // Update lit.Update(db, &user, "id = $1", user.Id) // Delete lit.Delete(db, "DELETE FROM users WHERE id = $1", id) }
Built and maintained by the Traceway team.
See lit in action — Traceway uses lit to power its observability platform for Go applications.
Visit Traceway