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
{{ message }}
Repository navigation
sqlc generate error: table alias "amounts" does not exist #1990
CREATETABLEIF NOT EXISTS wallets
(
id uuid NOT NULL DEFAULT uuid_generate_v4() PRIMARY KEY,
address VARCHAR(44) NOT NULL,
type VARCHAR(44) NOT NULL,
balance DECIMAL(32, 18) NULL
);
SQL queries
-- name: FindWallets :manyselect id, address, balance, total_balance from
(
select id, address, balance,
sum(balance) over (order by balance desc rows between unbounded preceding and current row) as total_balance,
sum(balance) over (order by balance desc rows between unbounded preceding and current row) - balance as last_balance
from wallets
where type=$1
) amounts
whereamounts.last_balance< $2;
Activity
test: Add case for #1990
fix(compiler): Pull in array information from analyzer (#2864)
kyleconroy commentedon Oct 24, 2023
This is fixed in v1.23.0 by enabling the database-backed query analyzer. We added a test case for this issue so it won’t break in the future.
You can play around with the working example on the playground
fix(compiler): Pull in array information from analyzer (sqlc-dev#2864)