Skip to content

Releases: sbdchd/squawk

Add more validation to parser + fmt improvements

Choose a tag to compare

@sbdchd sbdchd released this 10 Sep 04:09
0feae0d

Added

  • parser: validation for builtin keyword usages & more (#1338)
  • parser: validation for json_array/json_object, fmt quoting fixes (#1337)
  • parser: validation for empty lists & related (#1336)
  • parser: validation for extra commas/func args/only/graph table (#1335)

Changed

  • parser: refactor named arg to not be a general expr (#1332)

Fixed

  • fmt: fix identing for select clauses (#1339)
  • fmt: fix quoted func names (#1334)
  • fmt: fix more cases where we drop comments (#1333)
  • fmt: adjust values rows & fix keyword quoting (#1330)

Update prefer-robust-stmts to be alembic version aware + code formatter

Choose a tag to compare

@sbdchd sbdchd released this 01 Sep 03:41
0c55115

Added

  • linter: prefer-robust-stmts aware of alembic version update transactions (#1311). Thanks @DylanGriffith!

  • fmt: support for all statements (#1321, #1319, #1317, #1312, #1310, #1309, #1307, #1306, #1305, #1303, #1302, #1300, #1299)

  • ide: add formatting support (#1315)

  • ide: code action isnull -> is null, notnull -> is not null (#1296)

  • ide: code actions for func params (#1322)

  • ide: code action to convert default to = in function syntax (#1316)

  • ide: code actions for :=/=> & value/: rewrites (#1313)

  • parser: validation for variadic, function defaults, params (#1325, #1324, #1323)

  • parser: validate string literal type cast (#1320)

  • playground: add code formatting output (#1326)

Changed

  • parser: split bit & time type ast nodes (#1297)
  • parser: add nodes for interval & array bounds (#1301)
  • parser: improve parsing of operators in using and exclude (#1304)
  • parser: refactor percent type out of ast::Type (#1318)
  • parser: refactor char type into character and varchar nodes (#1295)

Fixed

  • syntax: fix unquoting & add more funcs (#1298)

ban-duplicate-column-assignment checks more queries

Choose a tag to compare

@sbdchd sbdchd released this 19 Aug 04:31
5c2d07e

Added

  • syntax: add validation for empty tuple & overlaps (#1292)

  • syntax: add validation for in/not in (#1287)

  • ide: goto def for prepared transactions (#1291)

  • ide: goto def for savepoints (#1290)

  • ide: goto def for builtins like extract/substring/position (#1289)

  • ide: code actions for builtins -> pg functions (#1288)

  • ide: code actions unnest <-> rows from (#1284)

  • parser: split AliasColumnList into ColumnList & ColumnDefList (#1282)

  • parser: add more enums to ast (#1281, #1280, #1277, #1276)

Changed

  • linter: update ban-duplicate-column-assignment to check more queries (#1274)

Fixed

  • playground: fix code actions (#1286)
  • parser: fix select parsing & add more node detail (#1279)

Add ban-duplicate-column-assignments rule + parser improvements

Choose a tag to compare

@sbdchd sbdchd released this 06 Aug 04:42
4cc2268

Added

  • linter: add ban-duplicate-column-assignments rule (#1263, #1262)
  • ide: add code action to switch between comment types (#1271)
  • ide: add code action Rewrite integer as (#1266)
  • ide: fold where clauses (#1265)

Changed

Fixed

Parser Improvements & A Parser Fix

Choose a tag to compare

@sbdchd sbdchd released this 25 Jul 03:22
b4f0f66

Changed

  • ide: refactor to use AnyName node (#1250)

  • parser: refactor ast::RelationFromItem to use ast::RelationNameRef (#1251)

  • parser: add more nodes for ast on top of cst -> more enums (#1248)

  • parser: refactor Name/NameRef to more specific nodes (#1246, #1247)

    This also fixes schema qualified sequence names:

    CREATE TABLE foo (
        id int GENERATED ALWAYS AS IDENTITY (SEQUENCE NAME public.myseq START 1)
    );

require-timeout-settings rule is split & lock warning improvements

Choose a tag to compare

@sbdchd sbdchd released this 19 Jul 00:35
2739323

Added

  • linter: split require-timeout-settings rule (#1233, #1217). Thanks @zvdy!

    Now there's require-lock-timeout and require-statement-timeout

  • linter: require-timeout-settings explain lock impact in the warning (#1216, #1219). Thanks @edeetee!

    Now instead of saying:

    Missing `set lock_timeout` before potentially slow operations
    

    We say:

    Missing `set lock_timeout` before potentially slow ACCESS EXCLUSIVE lock operations
    
  • parser: add pg19 support for json_table plan & index include columns (#1243)

Changed

  • parser: add type specific rename nodes for alter statements (#1244)
  • parser: add more specific name nodes (#1242)
  • parser: split Path into Path & PathRef (#1241)
  • parser: ast nodes for ColumnRef, FromItem union & more (#1232)

Fixed

  • server: goto def for text search, op class (#1239)
  • server: goto def on collate, type attrs, search path, fn column name (#1238)
  • server: fix goto def with select into, savepoints, paren join exprs (#1237)
  • server: fix goto def with paren join expr (#1236)
  • server: goto def for fn params, fn defaults, pub/sub, & more (#1234)
  • server: add goto def support for constraints + parser improvements (#1229)
  • server: fix various goto def gaps (#1227)
  • server: add goto def support for operators & more (#1240)
  • parser: fix explain/create rule/exists with extra parens (#1225)
  • parser: fix parsing insert/create view/declare with parens (#1224)
  • server: fix more goto def edge cases (#1223)
  • parser: error for invalid legacy copy stmts (#1221)
  • parser: fix option parsing edge cases (#1218)

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;