Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion internal/compiler/selector.go
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down Expand Up @@ -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
Expand Down
Loading