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
sqlc generate failed.
# package
query.sql:16:11: table alias"rc" does not exist
Database schema
CREATETABLEuser_referrals
(
user_id bigintNOT NULLCONSTRAINT user_referrals_pk
PRIMARY KEYCONSTRAINT user_referrals_users_id_fk
REFERENCES users
ON DELETE CASCADE,
referrer_id bigintNOT NULLCONSTRAINT user_referrals_users_id_fk_2
REFERENCES users
ON DELETESETNULL,
balance numeric(38, 9) DEFAULT 0.00NOT NULL,
created_at timestamp with time zone DEFAULT NOW() NOT NULL,
updated_at timestamp with time zone DEFAULT NOW() NOT NULL
);
SQL queries
-- name: GetReferralChain :many
WITH RECURSIVE referral_chain AS (
SELECT user_id,
referrer_id,
1AS level
FROM user_referrals r
WHEREr.user_id= $1UNION ALLSELECTr.user_id,
r.referrer_id,
rc.level+1FROM user_referrals r
JOIN referral_chain rc ONr.user_id=rc.referrer_idWHERErc.level< @level
)
SELECT*FROM referral_chain
;
Version
1.28.0
What happened?
Hello I got
Relevant log output
Database schema
SQL queries
Configuration
Playground URL
https://play.sqlc.dev/p/2678bbd6fdc4d323f3464abd3f5e27175b26b74ea7ca0cc779ec7c2395f689ad
What operating system are you using?
Windows
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: