Open
Description
Version
1.29.0
What happened?
set overrides for a field type json is not working

sqlc generate
GetOrderProductsRow.Additionals
should be json
custom type, not []byte
Relevant log output
Database schema
CREATE TABLE public.order_products (
id bigserial NOT NULL,
product_amount int4 NULL,
additionals json NULL,
order_id uuid NOT NULL,
product_id uuid NOT NULL,
created_at timestamp(6) NOT NULL,
updated_at timestamp(6) NOT NULL,
deleted bool DEFAULT false NULL,
product_price float8 NULL,
CONSTRAINT order_products_order_id_product_id_key UNIQUE (order_id, product_id),
CONSTRAINT order_products_pkey PRIMARY KEY (id),
CONSTRAINT fk_rails_96c0709f78 FOREIGN KEY (product_id) REFERENCES public.products(id),
CONSTRAINT fk_rails_f40b8ccee4 FOREIGN KEY (order_id) REFERENCES public.orders(id)
);
SQL queries
-- name: GetOrderProducts :many
SELECT
op.id,
op.product_amount,
op.additionals,
op.product_price,
p.name AS product_name
FROM order_products op
JOIN products p ON op.product_id = p.id
WHERE op.order_id = $1;
Configuration
version: "2"
sql:
- engine: "postgresql"
queries: "db/queries"
schema: "db/migrations"
gen:
go:
package: "db"
sql_package: "pgx/v5"
out: "internal/db"
overrides:
- db_type: "json"
go_type: "encoding/json.RawMessage"
Playground URL
No response
What operating system are you using?
mac
and linux
What database engines are you using?
postgresql
What type of code are you generating?
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
tuanvumaihuynh commentedon Jun 16, 2025
I downgraded to version 1.28.0 and it works.
XMitja commentedon Jun 30, 2025
I have a bunch of json/jsonb columns, functions and casts, doing exhaustive overrides got rid of all the []byte outputs