Open Source Go ORM

lit

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/v2

SQL-First

Write actual SQL queries. No DSLs, no query builders, no magic. Full control over every database operation.

Cached Queries

INSERT and UPDATE statements are pre-computed at registration. Zero runtime overhead for query generation.

Zero Code Generation

No build steps. No generated files to maintain. Import the library and start building immediately.

Lightweight

Only two dependencies: database/sql and uuid. Small binary footprint and fast compilation times.

Type Safe

Go generics provide compile-time type safety for all your database operations.

Flexible Mapping

Map query results to any struct. Use DTOs for JOINs, aggregations, and projections.

Simple by design

Define a struct. Register it. Query.

main.go
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)
}
Traceway

Built and maintained by the Traceway team.

See lit in action — Traceway uses lit to power its observability platform for Go applications.

Visit Traceway