# Masterminds/squirrel

Fluent SQL generation for golang

Repository: https://github.com/Masterminds/squirrel
Canonical: https://ross.abutalabs.com/products/squirrel
Language: Go
License: NOASSERTION
License Family: other
Last push: 2024-04-24T05:26:36+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 4610, "days_push": 861, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 7979, forks 511 (observed 2026-08-28T04:10:10.477196+00:00)

## What it is
Squirrel is a fluent SQL query builder library for Go that composes SELECT, INSERT, UPDATE, and DELETE statements from reusable parts. It is explicitly not an ORM; it generates SQL and placeholder arguments and can execute queries via database/sql.

## Use cases
- build sql queries programmatically in go
- compose conditional where clauses dynamically
- generate postgres queries with dollar placeholders
- avoid string-concatenating sql statements
- build insert statements with multiple values
- cache prepared statements in go

## When to choose
- you want composable, type-safe-ish SQL generation without a full ORM
- you need dynamic query building based on runtime conditions
- you target PostgreSQL and want placeholder formatting handled for you

## When to avoid
- you want an ORM with struct-to-table mapping and migrations
- you need a project under active feature development - Squirrel is declared complete and in maintenance
- you prefer raw SQL or a query builder for another language

## Facets
- artifact type: library
- maturity: maintenance
- function: database, orm, serialization
- domain: databases, developer-tools, backend
- platform: go, windows, cross-platform
- tags: sql-builder, query-builder, fluent-api, postgresql, not-an-orm, linux, macos

## Member repositories
- Masterminds/squirrel (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:10.477196+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-29T17:32:35.230993+00:00, confidence not recorded.
  - readme: https://github.com/Masterminds/squirrel (fetched 2026-08-28T04:10:10.477196+00:00, sha 6ca3284c77ec)
- Data as of 2026-08-30T08:39:29.467469+00:00.
