nene / sql-parser-cst

Parses SQL into Concrete Syntax Tree (CST)
GNU General Public License v2.0
115 stars 7 forks source link

Postgres support #71

Closed kevbook closed 2 months ago

kevbook commented 2 months ago

Just adding, so you can dig into this. Following fails:

/** -------------------------------------------------------
 * Reset the current session role to the original session
 * ------------------------------------------------------- */
SET ROLE NONE;
SELECT *,
  rolconfig AS search_path,
  ARRAY(SELECT t3.rolname
    FROM pg_catalog.pg_auth_members t2
    JOIN pg_catalog.pg_roles t3 ON (t2.roleid = t3.oid)
    WHERE t1.oid = t2.member) as member_of
FROM pg_catalog.pg_roles t1
WHERE t1.rolname !~ '^(pg_|rds|neon_|cloud_|supabase_|_aiven)'
ORDER BY rolname;
nene commented 2 months ago
nene commented 2 months ago