You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I m facing issue on sqlc generation. UPDATE order_books SET buy_orders = ( SELECT jsonb_agg( CASE WHEN (elem->>'price')::numeric = $2 AND (elem->>'quantity')::int - $3 > 0 THEN jsonb_set(elem, '{quantity}', to_jsonb(((elem->>'quantity')::int - $3)::int)) ELSE elem END ) FROM jsonb_array_elements(buy_orders) "elem" WHERE (elem->>'price')::numeric = $2 AND (elem->>'quantity')::int - $3 > 0 OR (elem->>'price')::numeric != $2 ) WHERE market_id = $1;
above query working fine in pgadmin postgresql but facing issue in sqlc that "elem" does not exist.
Relevant log output
# package db
internal/order_book/database/queries/order_book.sql:27:19: column "elem" does not exist
Version
1.26.0
What happened?
I m facing issue on sqlc generation.
UPDATE order_books SET buy_orders = ( SELECT jsonb_agg( CASE WHEN (elem->>'price')::numeric = $2 AND (elem->>'quantity')::int - $3 > 0 THEN jsonb_set(elem, '{quantity}', to_jsonb(((elem->>'quantity')::int - $3)::int)) ELSE elem END ) FROM jsonb_array_elements(buy_orders) "elem" WHERE (elem->>'price')::numeric = $2 AND (elem->>'quantity')::int - $3 > 0 OR (elem->>'price')::numeric != $2 ) WHERE market_id = $1;
above query working fine in pgadmin postgresql but facing issue in sqlc that "elem" does not exist.
Relevant log output
Database schema
SQL queries
Configuration
Playground URL
https://play.sqlc.dev/p/ced68b9fe06ef660c5be4cb6c29f805f73bc623530dd15accbb969c10e40bf41
What operating system are you using?
macOS
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go
The text was updated successfully, but these errors were encountered: