From 9239d46548dcbd8650890b6e273e3d49c3525d5e Mon Sep 17 00:00:00 2001 From: Tim van Osch Date: Wed, 11 Mar 2026 12:07:11 +0100 Subject: [PATCH] fix(#4337): SQLite JSONB not coerced if type is capitalized --- internal/compiler/selector.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/compiler/selector.go b/internal/compiler/selector.go index 04d118ff9c..32175c3d67 100644 --- a/internal/compiler/selector.go +++ b/internal/compiler/selector.go @@ -1,5 +1,9 @@ package compiler +import ( + "strings" +) + // selector is an interface used by a compiler for generating expressions for // output columns in a `SELECT ...` or `RETURNING ...` statement. // @@ -39,7 +43,7 @@ func (s *sqliteSelector) ColumnExpr(name string, column *Column) string { // outside of the database itself. For jsonb columns in SQLite, wrap values // in `json(col)` to coerce the internal binary format to JSON parsable by // the user-space application. - if column.DataType == "jsonb" { + if strings.ToLower(column.DataType) == "jsonb" { return "json(" + name + ")" } return name