Suggestions appear as you type. Use the up and down arrows to choose one and Enter to open it.

This page's audience real numbers from our own analytics — open to see them
–Visitors
–Page views
–Clicks to vendors
–Time on page
–Reading now
Clicks to vendors, by tool
  • –
Top countries
  • –
Devices
  • –

– · counted by iTechGuides's own first-party analytics, bots removed, every figure rounded down · how we count

sq (Structured Query) review

Free#22 of 51 in Database Query Builders

A focused Go library for typed SQL building, data mapping, and migrations.

6.8/10Editor score
sq (Structured Query)6.8 Visit sq

Reviewed by iTechGuides Editors · Editorial team · Updated Oct 2026

sq is an open-source Go library for building SQL queries and mapping result rows to Go structs. It suits developers who want type-safe query construction and data mapping without adopting a full ORM. Its query-builder API covers SELECT, INSERT, UPDATE, and DELETE, while raw SQL templates with placeholders offer another way to express queries. The published platform details include Linux, Windows, macOS, and self-hosted use, so it can fit Go projects across those environments.

The main draw is its balance of typed construction and explicit SQL access. Queries can be compiled to SQL plus arguments, and the listed dialects are SQLite, PostgreSQL, MySQL, and SQL Server. That gives teams working with those databases a common library for query building while preserving visibility into the SQL being generated. Raw SQL templates provide an escape hatch for queries that do not fit the builder; developers still need to be comfortable authoring SQL where they choose that route. Query logging is also included, alongside fetch and execution functions.

Declarative schema migrations extend sq beyond query construction, making it relevant to teams that want migration support in the same Go library. Its scope remains deliberately narrower than a full ORM: it focuses on query building and mapping rather than a broader set of ORM abstractions. Choose sq if a Go codebase needs typed queries, mapping, and migrations across its listed SQL dialects. Teams seeking a language-neutral tool or a full ORM should consider a broader alternative. The README says Go 1.19+ while the linked documentation says Go 1.18+, so check the relevant compatibility guidance for a project.

sq (Structured Query) pros and cons

  • Where it wins
    • Build typed SELECT, INSERT, UPDATE, and DELETE queries in Go
    • Compile queries to SQL and arguments across four listed dialects
    • Add declarative schema migrations and query logging
  • Where it doesn't
    • Focused on Go rather than supporting multiple programming languages
    • Not a full ORM for teams seeking broader data-access abstractions
    • Raw SQL templates still require developers to write SQL

sq (Structured Query) fact sheet, pricing and score →

Advertiser disclosure: iTechGuides is reader-supported. Vendors can pay for top positions in our rankings and for a place on other products' pages, and we may earn a commission when you click some links. How we rank.

Last updated · How we research and update