<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: suiriass</title>
    <description>The latest articles on DEV Community by suiriass (@suiriass).</description>
    <link>https://dev.to/suiriass</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4004166%2F3b13986a-4e09-4821-81e6-fa1ec661f09b.jpg</url>
      <title>DEV Community: suiriass</title>
      <link>https://dev.to/suiriass</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/suiriass"/>
    <language>en</language>
    <item>
      <title>sqlex — A Modern Drop-in Replacement for jmoiron/sqlx</title>
      <dc:creator>suiriass</dc:creator>
      <pubDate>Sat, 27 Jun 2026 03:28:10 +0000</pubDate>
      <link>https://dev.to/suiriass/sqlex-a-modern-drop-in-replacement-for-jmoironsqlx-2d7i</link>
      <guid>https://dev.to/suiriass/sqlex-a-modern-drop-in-replacement-for-jmoironsqlx-2d7i</guid>
      <description>&lt;p&gt;title: sqlex — A Modern Drop-in Replacement for jmoiron/sqlx&lt;br&gt;
published: false&lt;br&gt;
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+.&lt;br&gt;
tags: go, database, sql, opensource&lt;/p&gt;
&lt;h2&gt;
  
  
  If you use sqlx, this is worth 3 minutes of your time
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;jmoiron/sqlx&lt;/code&gt; has been the go-to SQL extension library for Go for years. Struct mapping, named parameters, &lt;code&gt;IN&lt;/code&gt; clause expansion — it made &lt;code&gt;database/sql&lt;/code&gt; actually pleasant to use. I've used it in almost every Go project I've worked on.&lt;/p&gt;

&lt;p&gt;But here's the reality: &lt;strong&gt;its activity has been modest at best, and has slowed to a crawl in recent years.&lt;/strong&gt; Hundreds of issues sit untouched. PRs go unanswered. Bugs reported years ago are still there, waiting to cause production incidents.&lt;/p&gt;

&lt;p&gt;This isn't a knock on sqlx — it's a great library with solid design. But an unmaintained foundational library is a liability.&lt;/p&gt;
&lt;h2&gt;
  
  
  So we built sqlex
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;sqlex&lt;/code&gt; is a &lt;strong&gt;drop-in replacement&lt;/strong&gt; for &lt;code&gt;jmoiron/sqlx&lt;/code&gt; that is &lt;strong&gt;100% API-compatible&lt;/strong&gt;. All sqlx methods (&lt;code&gt;Get&lt;/code&gt;, &lt;code&gt;Select&lt;/code&gt;, &lt;code&gt;Exec&lt;/code&gt;, &lt;code&gt;NamedQuery&lt;/code&gt;, &lt;code&gt;Preparex&lt;/code&gt;, etc.) work identically.&lt;/p&gt;

&lt;p&gt;Migrating takes &lt;strong&gt;30 seconds&lt;/strong&gt; — just change the import path:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="s"&gt;"github.com/jmoiron/sqlx"&lt;/span&gt;
&lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="s"&gt;"github.com/go-sqlex/sqlex"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🐛 20+ bug fixes from sqlx, all fixed&lt;/p&gt;

&lt;p&gt;🚀 New features sqlx never had&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Auto-Rebind — write ? everywhere, works on PostgreSQL ($1), MySQL (?), SQLite (?), SQL Server (&lt;a class="mentioned-user" href="https://dev.to/p1"&gt;@p1&lt;/a&gt;). No more manual db.Rebind().&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SQL parsing fixes — colons in strings, :: type casts, ? in comments are correctly handled. Silent bugs from sqlx are gone.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Auto IN expansion — slices in IN (?) are detected and expanded automatically on all methods.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Hook system — pluggable SQL interceptors for logging, tracing, metrics (onion model).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;JSONValue[T] — generic JSON column type with auto serialize/deserialize.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;StrictMode — lenient by default (matching sqlx Unsafe()), optionally strict for debugging.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Unified interfaces — Ext / ExtContext / NamedExt / BindExt with compile-time checks.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Project status&lt;br&gt;
Version: v1.5.3 (just released, actively maintained)&lt;/p&gt;

&lt;p&gt;Go version: 1.21+&lt;/p&gt;

&lt;p&gt;License: MIT&lt;/p&gt;

&lt;p&gt;100% API-compatible with sqlx&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;sqlex isn't a rewrite. It's a modernization that keeps what sqlx got right and fixes what it got wrong.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/go-sqlex/sqlex" rel="noopener noreferrer"&gt;https://github.com/go-sqlex/sqlex&lt;/a&gt;&lt;/p&gt;

</description>
      <category>go</category>
      <category>database</category>
      <category>sql</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
