OSS TanbouSign in with GitHub

extend database/sql with struct scanning and named queries without replacing its interfaces

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
17,743
Primary language
Go
License
MIT
Repository last updated
Aug 15, 2024
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.

Sources: [3][2][4]

Official sources

  1. [1]jmoiron/sqlx — GitHub repository(2026-10-06)
  2. [2]sqlx v1.4.0 — README(2026-10-06)
  3. [3]sqlx v1.4.0 — go.mod(2026-10-06)
  4. [4]sqlx v1.4.0 release(2026-10-06)
  5. [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. 1

    Get the source

    git clone --depth 1 https://github.com/jmoiron/sqlx.git
  2. 2

    Enter the repository

    cd sqlx
  3. 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
Check the official README

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

GitHub data

GitHub dataView detailed GitHub data
Stars
17,743
Forks
1,119
Watchers
194
Open issues
318
Contributors
76
Owner type
User
Primary language
Go
License
MIT
Repository last updated
Aug 15, 2024
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?