finds.dev

upper/db

Data Access Layer (DAL) for PostgreSQL, CockroachDB, MySQL, SQLite and MongoDB with ORM-like features.

View on GitHubHomepage ↗

★ 3,658GoMITupdated Dec 2025

// the take

upper/db is a Go data access layer that wraps PostgreSQL, MySQL, SQLite, CockroachDB, MongoDB, and MSSQL behind a common interface. It sits between raw database/sql and a full ORM — you get collection/result abstractions and struct mapping without migrations or schema management. Aimed at Go developers who want more than raw SQL but less than GORM.

The adapter pattern is well-executed: each database gets its own package with driver-specific connection handling (pgx vs pq for Postgres, for example), so you're not forced into a lowest-common-denominator implementation. The internal sqlbuilder is a real SQL builder, not string concatenation — exql has proper AST nodes for clauses, which means generated SQL is predictable and testable. Test infrastructure is thorough: Ansible playbooks to spin up each database, a shared generic test suite run against every adapter, so regressions across databases are caught. The immutable query builder pattern means chaining Result() calls doesn't mutate state, which avoids a whole class of subtle bugs common in fluent APIs.

No migration support at all — you have to bring your own (golang-migrate, goose, etc.), which is fine philosophically but means upper/db can't be your only database dependency. The MongoDB adapter is structurally different from the SQL adapters but shares the same interface, and that abstraction leaks badly when you need anything MongoDB-specific like aggregation pipelines or transactions with sessions. Last meaningful activity looks like late 2025 and star growth has plateaued at ~3.7k, which for a project this old (v4 has been around since ~2020) suggests the community is not growing — GORM and sqlc have eaten the space from above and below. Documentation lives at upper.io but the site has been neglected; the 'tour' at tour.upper.io is the main getting-started resource and it's not clear it's still maintained.

We read the README, the directory tree and a key source file in June 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
3,658
Forks
238
Language
Go
License
MIT
Last commit
6 Dec 2025

// nearby

If db isn't quite it.

All repos →