{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreifasb7jltaumr4q4ueiwi75srffvxbovmgowyypdynqnne3ek7jke",
    "uri": "at://did:plc:25rdn5elo5izoxrmtis34zuk/app.bsky.feed.post/3mpaknbjq3tt2"
  },
  "coverImage": {
    "$type": "blob",
    "ref": {
      "$link": "bafkreigmscjbxaqf2wtpea6g2zrl5bdvtkv7pkaluc3fuuwfbqommwfs5y"
    },
    "mimeType": "image/webp",
    "size": 158540
  },
  "path": "/suiriass/sqlex-a-modern-drop-in-replacement-for-jmoironsqlx-2d7i",
  "publishedAt": "2026-06-27T03:28:10.000Z",
  "site": "https://dev.to",
  "tags": [
    "go",
    "database",
    "sql",
    "opensource",
    "@p1",
    "https://github.com/go-sqlex/sqlex"
  ],
  "textContent": "title: sqlex — A Modern Drop-in Replacement for jmoiron/sqlx\npublished: false\ndescription: sqlex is a fully API-compatible modernization of jmoiron/sqlx that fixes 20+ long-standing bugs, adds pluggable hooks, auto IN expansion, and more. Built for Go 1.21+.\ntags: go, database, sql, opensource\n\n##  If you use sqlx, this is worth 3 minutes of your time\n\n`jmoiron/sqlx` has been the go-to SQL extension library for Go for years. Struct mapping, named parameters, `IN` clause expansion — it made `database/sql` actually pleasant to use. I've used it in almost every Go project I've worked on.\n\nBut here's the problem: **it's basically frozen.**\n\nBut here's the reality: its activity has been modest at best, and has slowed to a crawl in recent years. Hundreds of issues sit untouched. PRs go unanswered. Bugs reported years ago are still there, waiting to cause production incidents.\n\nThis isn't a knock on sqlx — it's a great library with solid design. But an unmaintained foundational library is a liability.\n\n##  So we built sqlex\n\n`sqlex` is a **drop-in replacement** for `jmoiron/sqlx` that is **100% API-compatible**. All sqlx methods (`Get`, `Select`, `Exec`, `NamedQuery`, `Preparex`, etc.) work identically.\n\nMigrating takes **30 seconds** — just change the import path:\n\n\n\n    - import \"github.com/jmoiron/sqlx\"\n    + import \"github.com/go-sqlex/sqlex\"\n\n\nšŸ› 20+ bug fixes from sqlx, all fixed\n\nšŸš€ New features sqlx never had\n\n  * Auto-Rebind — write ? everywhere, works on PostgreSQL ($1), MySQL (?), SQLite (?), SQL Server (@p1). No more manual db.Rebind().\n\n  * SQL parsing fixes — colons in strings, :: type casts, ? in comments are correctly handled. Silent bugs from sqlx are gone.\n\n  * Auto IN expansion — slices in IN (?) are detected and expanded automatically on all methods.\n\n  * Hook system — pluggable SQL interceptors for logging, tracing, metrics (onion model).\n\n  * JSONValue[T] — generic JSON column type with auto serialize/deserialize.\n\n  * StrictMode — lenient by default (matching sqlx Unsafe()), optionally strict for debugging.\n\n  * Unified interfaces — Ext / ExtContext / NamedExt / BindExt with compile-time checks.\n\n\n\n\nProject status\nVersion: v1.5.3 (just released, actively maintained)\n\nGo version: 1.21+\n\nLicense: MIT\n\n100% API-compatible with sqlx\n\nsqlx was great for its time, and its design still holds up. But the lack of maintenance — the unfixed lexer bugs, the inconsistent APIs, the silent data corruption issues — adds real cost to real projects.\n\nsqlex isn't a rewrite. It's a modernization that keeps what sqlx got right and fixes what it got wrong.\n\nIf you're using sqlx and you've run into any of the issues above, give sqlex a try. The migration is trivial, and the improvements are real.\n\nGitHub: https://github.com/go-sqlex/sqlex",
  "title": "sqlex — A Modern Drop-in Replacement for jmoiron/sqlx"
}