github.com/supabase/cli@v1.168.1/internal/utils/parser/testdata/split_13.sql (about) 1 2 3 CREATE VIEW "blocks"."block_count" AS 4 SELECT 5 b."uuid" AS "block_uuid", 6 ( 7 (SELECT COUNT(*) 8 FROM "blocks"."placement" p 9 WHERE p."block_uuid" = b."uuid") 10 + 11 (SELECT COALESCE(SUM((SELECT COUNT(*) 12 FROM unnest(c."child_uuids") cb 13 WHERE cb = b."uuid")), 0) 14 FROM "blocks"."child_blocks" c) 15 ) AS "ref_count", 16 (SELECT COUNT(*) 17 FROM "blocks"."user_bucket" k 18 WHERE "uuid" = ANY (k."block_uuids")) AS "user_count" 19 FROM "blocks"."block" b;