# jackc/tern

The SQL Fan's Migrator

Repository: https://github.com/jackc/tern
Canonical: https://ross.abutalabs.com/products/jackc-tern
Language: Go
License: MIT
License Family: permissive
Last push: 2026-08-23T00:46:03+00:00

## Health v2 (maintenance only)
Score: 95/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 87, longevity 100
- inputs: {"age_days": 5685, "days_push": 11, "days_rel": 11, "gap_med": 56, "n_releases_24m": 8}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1316, forks 86 (observed 2026-08-28T04:04:20.864767+00:00)

## What it is
Tern is a standalone SQL schema migration tool for PostgreSQL, usable as a CLI binary or Go library. It supports SQL and Go function migrations, SSH tunnels, variable interpolation, and a separate workflow for managing database code like functions and views.

## Use cases
- run postgres schema migrations from the command line
- manage database functions and views as code
- migrate a postgres database in a CI pipeline
- apply sql migrations with variable interpolation
- run database migrations over an ssh tunnel
- embed a migration tool in a go application

## When to choose
- you use PostgreSQL and prefer plain SQL migrations over ORM-based ones
- you need a lightweight standalone migrator or a Go library
- you need SSH tunneling or template-based config for migrations

## When to avoid
- you need migrations for databases other than PostgreSQL
- you want declarative/diff-based schema management rather than ordered migration files

## Facets
- artifact type: cli-tool
- maturity: active
- function: database, cli, developer-tools
- domain: databases, developer-tools, backend
- platform: windows, go, cli
- tags: sql-migrations, postgresql, schema-migration, database-migrations, linux, macos

## Member repositories
- jackc/tern (main) score 95

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:20.864767+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-30T04:48:29.347981+00:00, confidence not recorded.
  - readme: https://github.com/jackc/tern (fetched 2026-08-28T04:04:20.864767+00:00, sha eb519781585e)
- Data as of 2026-08-30T08:39:29.467469+00:00.
