Skip to content

Releases: sbdchd/squawk

Postgres 19 Parser Support + Various Fixes to Parser & Lexer

Choose a tag to compare

@sbdchd sbdchd released this 27 Jun 19:12
c0568d9

Added

  • parser: support pg19 null treatment in aggregates (#1210)

Fixed

  • parser: codegen COL_NAME_KEYWORD_FIRST and TYPE_FUNC_NAME_KEYWORDS (#1209)
  • parser: fix graph_table not parsing as a column name (#1208)
  • parser: remove dead code & fix panics (#1207, #1206, #1204)
  • parser: fix invalid field accesses causing panics (#1205)
  • parser/lexer: give national strings own type, support $$ quoted string err recovery (#1213, #1211, #1212)
  • lexer: fix lexing 123$abc & string continuation validation (#1214)

Parser Fixes & Improvements

Choose a tag to compare

@sbdchd sbdchd released this 14 Jun 01:21
b80f283

Added

  • parser: surface variadic token in Arg AST node (#1201)

Fixed

  • parser: fix gaps with cte search/cycle, grant, vacuum, at local, & more (#1198, #1199, #1200)
  • parser: fix collate parsing in create table + more (#1197)

Fix False Positive with Require Schema Rule & Github Actions Output Clobbering

Choose a tag to compare

@sbdchd sbdchd released this 06 Jun 23:33
64d367c

Added

  • fmt: support comments in group by (#1194)

Fixed

  • linter: fix github actions output clobbering json/gcc (#1192)

  • linter: fix require table schema false positive on temp tables (#1191)

    Previously this would error:

    create temp table t (id bigint);
  • parser: fix various ast gaps (#1190)

  • parser: fix index option parsing (#1188)

    Previously this wouldn't parse:

    create index index_name on public.table_name using gin (column_name public.gin__int_ops);
  • parser: add ast nodes & fix alter restart (#1193)

Fix Precommit Install & IDE Improvements

Choose a tag to compare

@sbdchd sbdchd released this 02 Jun 23:08
b0fc478

Fixed

  • ci: fix precommit install by declaring optional dependencies (#1180)

  • ide: fix select * w/ create view & more (#1184)

    The following now works correctly:

    create table t(a int);
    --             ^ dest
    create view v as table t;
    select a$0 from v;
    --     ^ src
  • ide: treat select into like create table as (#1183)

    create table t(a bigint);
    --             ^ dest
    select * into u from t;
    select a from u;
    --     ^ src
  • ide: fix column resolution with cte & shadowing (#1182)

    with outer_cte as (select 1 c)
    --                          ^ dest
    select * from (
      with inner_cte as (select 2 d)
      select c from outer_cte
    --       ^ src
    ) s;
  • ide: fix aliases not hiding original name (#1181)

    create table t(a int);
    update t as u set a = t.a;
    --                    ^ error
  • ide: fix cte & alias resolution (#1179)

      with
        a as (select * from b),
    --                      ^ src doesn't resolve
        b as (select 1 x)
      select * from a;
  • ide: don't resolve trailing FromItems in a lateral subquery (#1177)

    with
      d as (select 1 id, 2 amount),
      c as (select 2 id)
    select r.amount
    from
      d,
      lateral (
        select d.amount
        from d
        where d.id = c.id
        --           ^ src doesn't resolve
        limit 1
      ) r,
      c;

Parser Improvements & Fixes + Error Docs Hyperlinks

Choose a tag to compare

@sbdchd sbdchd released this 27 May 23:32
bc2ff90

Added

  • parser: validation for default usages (#1175)

    -- ok
    insert into t values (default);
    -- err
    select default;
  • linter: setup hyperlinks for rule names in terminal (#1174)

    If your terminal supports it, then clicking on the rule name will navigate
    you to the docs.

Fixed

  • fmt: upgrade tiny_pretty to latest (#1173)

    We no longer wrap statements unless necessary.

  • parser: fix parsing period column (#1172)

    previously we'd error on:

    create table t (
      symbol text,
      period text,
      year int,
      quarter int,
      primary key (symbol, period, year, quarter)
    );

More Parser Validation + CI Hardening

Choose a tag to compare

@sbdchd sbdchd released this 24 May 23:20
c3dc1e6

v2.54.0 - 2026-05-24

Added

  • lexer: add parsing and erroring for num trailing suffix (#1159)

    error[syntax-error]: trailing junk after numeric literal
      β•­β–Έ stdin:1:11
      β”‚
    1 β”‚ SELECT 0x0y;
      β•°β•΄          ━
    
  • parser: warn about empty / invalid params & empty quoted idents (#1164)

    error[syntax-error]: empty delimited identifier
      β•­β–Έ stdin:1:8
      β”‚
    1 β”‚ select "", $, $2147483648
      β•°β•΄       ━━
    error[syntax-error]: missing parameter number
      β•­β–Έ stdin:1:12
      β”‚
    1 β”‚ select "", $, $2147483648
      β•°β•΄           ━
    error[syntax-error]: parameter number too large
      β•­β–Έ stdin:1:15
      β”‚
    1 β”‚ select "", $, $2147483648
      β•°β•΄              ━━━━━━━━━━━
    
  • parser: warn about invalid octal/hex/binary digits (#1163)

    error[syntax-error]: invalid digit for a base 2 literal
      β•­β–Έ stdin:1:12
      β”‚
    1 β”‚ select 0b104, 0o7719, 0xg
      β•°β•΄           ━
    error[syntax-error]: invalid digit for a base 8 literal
      β•­β–Έ stdin:1:20
      β”‚
    1 β”‚ select 0b104, 0o7719, 0xg
      β•°β•΄                   ━
    error[syntax-error]: trailing junk after numeric literal
      β•­β–Έ stdin:1:25
      β”‚
    1 β”‚ select 0b104, 0o7719, 0xg
      β•°β•΄                        ━
    
  • parser: improve error reporting for malformed literals (#1162)

    error[syntax-error]: trailing junk after positional parameter
      β•­β–Έ stdin:1:10
      β”‚
    1 β”‚ SELECT $1a;
      β•°β•΄         ━
    

    instead of

    error[syntax-error]: trailing junk after positional parameter
      β•­β–Έ stdin:1:10
      β”‚
    1 β”‚ SELECT $1a;
      β•°β•΄       ━━━
    
  • parser: improve lexing numbers (#1161)

    select .4;

    now produces:

    NUMERIC_NUMBER@7..9 ".4"
    

    instead of:

    INT_NUMBER@7..9 ".4"
    
  • ide: goto def for t.c%type (#1161)

    create table t(a int, b text);
    --           ^ dest
    create function f(x t.a%type) returns s.t.b%type
    --                  ^ source
      as $$ select 'hello'::text $$ language sql;
  • ide: find refs for types like bit (#1153)

    create type pg_catalog.bit;
    --                     ^^^ source
    
    create function pg_catalog.bit(bigint, integer) returns bit
    --                                                      ^^^ ref
      language internal;
  • ide: add hover for string literals (#1155)

    Now we decode the escape sequences for string literals on hover and show the
    value up to the first new line.

  • ide: improve numeric literal type inference (#1156)

    select 2147483647; -- type: integer
    select 2147483648; -- type: bigint
    select 100000000000000000000000; -- type: numeric
  • fmt: literals & binary operators (#1169)

    Format binary operators and literals.

    -- before
    select TRUE  and  FALSE;
    select X'AF';
    
    -- after
    select true and false;
    select
      x'AF';
  • fmt: unquote column aliases when possible (#1168)

    -- before
    select 1 as "foo";
    
    -- after
    select 1 as foo;

Changed

Fixed

  • lexer: fix unicode escape string issue (#1158)
  • vscode: update TextMate grammar to support other numeric literal kinds (#1157)

v2.53.0 - 2026-05-17

Added

  • parser: validate string continuations (#1137)
  • parser: improve create rule ast (#1147)

Changed

  • parser: update ast nodes to include their trailing semicolons (#1145, #1148)

Fixed

  • install: fix windows npx install bug (#1140)

Fix NPX Windows Install + Parser Improvements

Choose a tag to compare

@sbdchd sbdchd released this 17 May 23:52
3a77b6d

Added

  • parser: validate string continuations (#1137)
  • parser: improve create rule ast (#1147)

Changed

  • parser: update ast nodes to include their trailing semicolons (#1145, #1148)

Fixed

  • install: fix windows npx install bug (#1140)

Fix NPM Package Publishing

Choose a tag to compare

@sbdchd sbdchd released this 13 May 02:46
980dc05

Changed

Attempt to fix npm install method

Improved Parser Validation for Strings + Updated Install Method

Choose a tag to compare

@sbdchd sbdchd released this 13 May 01:37
4f5762b

Added

  • parser: validation for bit, byte, and escape string types (#1132)

    select b'01' '10';
    select x'0F' '10';
    select e'foo' 'bar';

    now gives:

    error[syntax-error]: Expected new line or comma between string literals
      β•­β–Έ stdin:1:13
      β”‚
    1 β”‚ select b'01' '10';
      β•°β•΄            ━
    error[syntax-error]: Expected new line or comma between string literals
      β•­β–Έ stdin:2:13
      β”‚
    2 β”‚ select x'0F' '10';
      β•°β•΄            ━
    error[syntax-error]: Expected new line or comma between string literals
      β•­β–Έ stdin:3:14
      β”‚
    3 β”‚ select e'foo' 'bar';
      β•°β•΄             ━
  • parser: validation for escape sequences (#1125, #1123, #1122, #1128, #1129)

    select U&'wrong: !061' UESCAPE '!';
    select U&"wrong: \06" UESCAPE '\';

    now gives:

    error[syntax-error]: Unicode escape requires 4 hex digits: !XXXX
      β•­β–Έ stdin:1:20
      β”‚
    1 β”‚   select U&'wrong: !061' UESCAPE '!';
      β•°β•΄                   ━━━━
    error[syntax-error]: Unicode escape requires 4 hex digits: \XXXX
      β•­β–Έ stdin:2:20
      β”‚
    2 β”‚   select U&"wrong: \06" UESCAPE '\';
      β•°β•΄                   ━━━

Changed

  • ci: update npm based install method (#1133)

    Instead of fetching the binary via an install script we use an optional
    peer dependency, mirroring ESBuild and Sentry.

Fixed

  • cli: fix missing binary exit code (#1130)

    Before if the install script didn't run the NPM JS shim would exit without
    erroring. Thanks @nwalters512!

  • parser: parsing unicode escape idents in cast position (#1127)

    select 2::U&"!0069!006E!0074!0038" UESCAPE '!' from t;

    now parses without error

File Level Disable Comment For `assume_in_transaction`

Choose a tag to compare

@sbdchd sbdchd released this 07 May 01:07
d08deab

v2.51.0 - 2026-05-06

Added

  • linter: add file-level override to disable assume_in_transaction (#996). Thanks @reteps!

    When using assume-in-transaction, you can disable it on a per file basis using a comment:

    -- squawk-disable-assume-in-transaction
  • syntax: add validation for select into (#1116)

    Warn about invalid usages, such as:

    • select 4 a union select 5 a into t;
    • with t as (select 1 a into t) select * from t;
    • select * from t where a in (select 1 a into t);

    and more!

  • parser: add empty statement to ast (#1111)

    ;
    ;
    ;

    now gives:

    SOURCE_FILE@0..5
      EMPTY_STMT@0..1
        SEMICOLON@0..1 ";"
      WHITESPACE@1..2 "\n"
      EMPTY_STMT@2..3
        SEMICOLON@2..3 ";"
      WHITESPACE@3..4 "\n"
      EMPTY_STMT@4..5
        SEMICOLON@4..5 ";"
    
  • ide: code actions create table as <-> select into + parser fix (#1113)

    Create table and select into are roughly interchangable, so this code action
    supports switching between.

  • ide: show comments for types and columns (#1110)

  • ide: hover infer more types for columns (#1109, #1108)

Changed

  • parser: cleanup insert & create rule ast grammar to be more strict (#1112)

Fixed

  • vscode: fix text mate grammar for multiple stmts on a line (#1115)
  • ide: fix infer column name w/ column aliases and goto def (#1118)
  • ide: fix output column alias resolution in group by / order by (#1117)
  • ide: fix inherit/like resolution + cte fixes (#1107)