On this page
Overview
sqlx extends Go's standard database/sql library. It preserves the underlying DB, transaction, and statement interfaces while adding struct/map/slice scanning, named parameters, and helpers such as Get and Select to reduce SQL-oriented data-access boilerplate.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Adopt it incrementally as a superset wrapper around database/sql
sqlx.DB, sqlx.Tx, and sqlx.Stmt preserve standard database/sql behavior while adding helpers, making existing code and drivers relatively easy to integrate.
Sources: [2]
Use StructScan, named queries, Get, and Select for concise row mapping
Query results can be scanned into structs including embedded structs, maps, and slices; named parameters and prepared named statements complement single-row Get and multi-row Select helpers.
Sources: [2]
Best fit
Fits backends that want less scan boilerplate while keeping SQL explicit
It suits APIs, batch jobs, and business services that want application-owned SQL and transactions without introducing a full ORM.
Sources: [2]
Before adoption
v1.4.0 declares Go 1.10; the README requires compatibility with the two most recent Go versions for new changes
The v1.4.0 go.mod declares Go 1.10, while the README states that new changes must remain compatible with the two most recent Go versions. Validate the actual support envelope with the selected toolchain and database driver. Duplicate column names can also be ambiguous for struct or map scanning, so alias columns in joins.
Official sources
- [1]jmoiron/sqlx — GitHub repository(2026-10-06)
- [2]sqlx v1.4.0 — README(2026-10-06)
- [3]sqlx v1.4.0 — go.mod(2026-10-06)
- [4]sqlx v1.4.0 release(2026-10-06)
- [5]sqlx MIT license(2026-10-06)
Supplemental curator note
sqlx reduces database/sql boilerplate without replacing its core interfaces. It is a good fit when a service wants convenience helpers rather than a full ORM, while keeping SQL and transaction boundaries explicit.
Try it in 3 steps
- 1
Get the source
git clone --depth 1 https://github.com/jmoiron/sqlx.git - 2
Enter the repository
cd sqlx - 3
Check the official steps
Continue with the commands in the README Installation, Quick Start, or Getting Started section.
find . -maxdepth 1 -iname 'README*' -exec sed -n '1,220p' {} \; -quit
Growth
Growth trends · Last 30 days
17,743 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 0
- Open PRs
- 78
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- asyncpg8,098 Stars
3 shared tag(s) · 2 shared category(s)
access PostgreSQL directly from asyncio through a high-performance Python driver
Python - Psycopg2,504 Stars
3 shared tag(s) · 2 shared category(s)
connect Python services to PostgreSQL with synchronous and asynchronous APIs
Python - mysql22,273 Stars
3 shared tag(s) · 2 shared category(s)
connect Ruby to MySQL or MariaDB and handle SQL queries, prepared statements, and streaming results
Ruby - PostgreSQL22,283 Stars
3 shared tag(s) · 1 shared category(s)
combine SQL transactions, constraints, indexes, and extensible types/functions in an object-relational database engine
C - MySQL Server12,441 Stars
3 shared tag(s) · 1 shared category(s)
Run relational workloads with InnoDB transactions, SQL, replication, and high-availability tooling
C++ - GORM39,982 Stars
4 shared tag(s) · 2 shared category(s) · Same language
combine associations, transactions, and SQL building in a full-featured Go ORM
Go
Report incorrect information
Tell us if any listing information is incorrect or outdated.