惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

腾讯CDC
N
Netflix TechBlog - Medium
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
F
Fortinet All Blogs
大猫的无限游戏
大猫的无限游戏
I
InfoQ
V
V2EX
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
有赞技术团队
有赞技术团队
G
Google Developers Blog
L
LangChain Blog
博客园_首页
M
MIT News - Artificial intelligence
H
Hackread – Cybersecurity News, Data Breaches, AI and More
月光博客
月光博客
IT之家
IT之家
量子位
宝玉的分享
宝玉的分享
S
SegmentFault 最新的问题
Stack Overflow Blog
Stack Overflow Blog
V
Visual Studio Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
雷峰网
雷峰网

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
sqlex — A Modern Drop-in Replacement for jmoiron/sqlx
suiriass · 2026-06-27 · via DEV Community

suiriass

title: sqlex — A Modern Drop-in Replacement for jmoiron/sqlx
published: false
description: 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+.
tags: go, database, sql, opensource
cover_image: https://opengraph.githubassets.com/1/go-sqlex/sqlex

If you use sqlx, this is worth 3 minutes of your time

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.

But here's the problem: it's basically frozen.

The last proper release was in 2021. Hundreds of issues are sitting untouched. PRs go unanswered. Bugs that the community has reported years ago are still there, waiting to bite someone in production.

This isn't a knock on sqlx — it's a great library with solid design. But an unmaintained foundational library is a liability.

So we built sqlex

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.

Migrating takes 30 seconds — just change the import path:

- import "github.com/jmoiron/sqlx"
+ import "github.com/go-sqlex/sqlex"

🐛 20+ bug fixes from sqlx, all fixed

🚀 New features sqlx never had

  • Auto-Rebind — write ? everywhere, works on PostgreSQL ($1), MySQL (?), SQLite (?), SQL Server (@p1). No more manual db.Rebind().

  • SQL parsing fixes — colons in strings, :: type casts, ? in comments are correctly handled. Silent bugs from sqlx are gone.

  • Auto IN expansion — slices in IN (?) are detected and expanded automatically on all methods.

  • Hook system — pluggable SQL interceptors for logging, tracing, metrics (onion model).

  • JSONValue[T] — generic JSON column type with auto serialize/deserialize.

  • StrictMode — lenient by default (matching sqlx Unsafe()), optionally strict for debugging.

  • Unified interfaces — Ext / ExtContext / NamedExt / BindExt with compile-time checks.

Project status
Version: v1.5.3 (just released, actively maintained)

Go version: 1.21+

License: MIT

100% API-compatible with sqlx

sqlx 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.

sqlex isn't a rewrite. It's a modernization that keeps what sqlx got right and fixes what it got wrong.

If 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.

GitHub: https://github.com/go-sqlex/sqlex