m-novikov / tree-sitter-sql

SQL syntax highlighting for tree-sitter
MIT License
110 stars 32 forks source link

BEGIN ATOMIC (PostgreSQL 14+) #82

Open malthe opened 7 months ago

malthe commented 7 months ago

In PostgreSQL 14+ a new language mode is available to define a function:

Explanation:

Allow SQL-language functions and procedures to use SQL-standard function bodies

Here's an example which currently fails to parse:

CREATE FUNCTION test (integer)
    RETURNS int
    LANGUAGE SQL
    BEGIN ATOMIC
    SELECT $1;
    END;