DerekStride / tree-sitter-sql

SQL grammar for tree-sitter
http://derek.stride.host/tree-sitter-sql/
MIT License
149 stars 47 forks source link

PG: Support creation and usage of custom types #184

Closed matthias-Q closed 1 year ago

matthias-Q commented 1 year ago

Postgres allows to create custom types. The creation of types, tables that are using these types and the selection of columns with these types is not yet supported:

Here is an example:

CREATE TYPE obj AS (
    elem1 TEXT,
    elem2 INT
);

CREATE TABLE obj_tab (
    object obj
);

SELECT
    (object).elem1,
    (object).elem2,
FROM obj_tab

Docs: https://www.postgresql.org/docs/current/sql-createtype.html