PgHero

Live Queries

1 query

Pid Duration State
2838531 0.0 s active
r2dbc-postgresql db_user

        select to_jsonb(l.*) || jsonb_build_object('name', coalesce(tsl_l.custom_name, tsl_l.name, l.name))       as league,
               to_jsonb(s.*)                                                                    as season,
               to_jsonb(t.*) || jsonb_build_object('name', coalesce(tsl_t.custom_name, tsl_t.name, t.name), 'logo', coalesce(t.custom_logo, t.logo))       as team,
               to_jsonb(c.*)                                                                    as coach,
               tc.color           as team_color,
               tc.secondary_color as team_secondary_color,
               stt.position       as position,
               to_jsonb(coun.*) || jsonb_build_object('name', coalesce(tsl_coun.custom_name, tsl_coun.name, coun.name)) as country
        from teams as t
                 left join season_teams as st on st.team_id = t.external_id
                 left join league_seasons as ls on ls.id = st.league_season_id
                 left join seasons as s on s.external_i

You may need to restart your app servers afterwards.