# upper/db

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

Repository: https://github.com/upper/db
Canonical: https://ross.abutalabs.com/products/upper-db
Homepage: https://upper.io/
Language: Go
License: MIT
License Family: permissive
Topics: golang, orm, database, sql, upper, go, db, postgresql, mysql, nosql, sqlite, mongodb, dal, cockroachdb
Last push: 2025-12-06T13:39:47+00:00

## Health v2 (maintenance only)
Score: 48/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 55, release rhythm 8, longevity 100
- inputs: {"age_days": 4698, "days_push": 270, "days_rel": 542, "gap_med": 182, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3657, forks 237 (observed 2026-08-28T04:08:13.207259+00:00)

## What it is
upper/db is a productive data access layer (DAL) for Go that provides a database-agnostic, ORM-like API for working with SQL and NoSQL databases such as PostgreSQL, MySQL, SQLite, CockroachDB, MSSQL, and MongoDB. It supports CRUD operations, struct-to-query-result mapping, pagination, transactions, and a SQL builder for raw queries.

## Use cases
- query databases in Go without writing raw SQL
- use one consistent API across PostgreSQL, MySQL, and MongoDB
- map Go structs to database query results
- implement pagination for database result sets
- run database transactions from Go code
- mix ORM-style operations with raw SQL queries

## When to choose
- you want ORM-like productivity in Go while retaining the option to write raw SQL
- your application needs to support multiple database backends with a single API
- you need built-in pagination, transactions, and struct mapping

## When to avoid
- you need a full-featured ORM with advanced migrations and associations
- you prefer lightweight direct database drivers like database/sql
- you use a database engine not on the supported list

## Facets
- artifact type: library
- maturity: active
- function: orm, database, database-driver
- domain: databases, backend, web-development
- platform: go, windows, cross-platform
- tags: data-access-layer, sql-builder, postgresql, mysql, sqlite, mongodb, cockroachdb, crud, pagination, transactions, linux, macos

## Member repositories
- upper/db (main) score 48

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:13.207259+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:31:37.264864+00:00, confidence not recorded.
  - readme: https://github.com/upper/db (fetched 2026-08-28T04:08:13.207259+00:00, sha 7aa0418abae6)
  - homepage: https://upper.io/ (fetched 2026-08-29T09:25:46.919883+00:00, sha d1b8c8735101)
  - site_page: https://upper.io/v4/getting-started (fetched 2026-08-29T09:25:46.929239+00:00, sha 82c98a1d36ce)
- Data as of 2026-08-30T08:39:29.467469+00:00.
