All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
-
linter: add require-table-schema rule (#1046, #1064, #1073). Thanks @Flaiers!
Note: this rule is disabled by default and must be enabled via the new
--includeflag.-- error create table posts(id bigint); -- okay create table public.posts(id bigint);
-
parser: improve error recovery for misplaced join clauses (#1065)
The following now gives a concise error message:
-- join after the where select * from t where x > 1 join k on true;
-
parser: support more statement kinds in create schema parsing (#1061)
-
ide: semantic syntax highlighting improvements (#1059, #1060, #1068)
We now highlight all the tokens in types. We were missing some like
setof.Additionally, we highlight names by their underlying kind i.e., table, function, column. This is powered by goto def.
You can't tell from GitHub's highlighting, but if you use the language server, we now highlight the
bint.bas a function:create table t(a int); create function b(t) returns int as 'select 1' language sql; select b(t), t.b from t;
-
ide: show function comment on hover (#1070)
-
ide: code action to rewrite between != and <> (#1066)
-
ide: goto def for create property graph (#1074)
-
parser: fix param parsing (#1068)
Before,
double precisionwas parsed as a param nameddoublewith typeprecision. Now it's parsed correctly as an unnamed param of typedouble precision.create function f(double precision) returns int8 as 'select $1' language sql;
-
ide: semantic syntax highlighting (#1057, #1058, #1052)
-
ide: semantic syntax highlighting (#1048)
-
playground: update syntax highlighting language with codegen'd keywords (#1055, #1054)
-
vscode: update syntax highlighting to support more operators (#1047)
-
ide: goto def for user, current_user, session_user, & current_schema (#1056)
- ide: goto def support for dec & float(n) types (#1042)
- vscode: vendor and improve postgres syntax highlighting grammar (#1043, #1041, #1039)
- parser: sync pg regressions suite & support the new ForPortionOf clause (#1038)
- ide: fix column naming for dec & float(n) (#1040)
- server: add multi threading (#1032, #1031, #1030, #1029, #1028, #1026, #1024, #1018)
- parser: improve error recovery for expr_as_name_list (#1017)
- parser: sql/pgq cleanup & more sql/pgq test cases (#1016)
- parser: improve persistence parsing (#1013)
- internal: bump rust to 1.94 (#1015)
- linter: add require-enum-value-ordering rule (#992). Thanks @cabello!
- linter: add cross-file validation for
NOT NULLconstraint pattern (#957). Thanks @reteps! - parser: support postgres 18 graph language (#1010)
- parser: support new except table clause (#986)
- parser: alter type ast improvements (#993)
- playground: add code folding support (#1000)
- ide: folding range support (#999)
- ide: goto def window defs & over clauses (#994)
- ide: goto def subquery compound selects (#988)
- server: handle errors from handlers by converting to a lsp err response (#1005)
- parser: we weren't handling compound selects with extra parens (#989)
- server: pull based diagnostics (#1006)
- internal: replace lazy_static with std::sync::OnceLock (#1009)
- internal: HashMap -> FxHashMap, FxHashSet (#1007)
- server: refactor notification handling to embrace types (#1004)
- server: refactor request handling to embrace types (#1003)
- server: refactor lib.rs into separate files (#1002)
- ide: add thread module from rust-analyzer (#1001)
- parser: sync plpgsql test suite from postgres (#991)
- ide/playground: salsa most of the server functions (#981)
- ide: update sql stub codegen to include some extensions (#984)
- ide: quick action for
timestamp with out timezonetotimestamptz(#976) - ide: goto def for create aggregate params (#972)
- ide: hover/goto def for subquery w/ alias (#970)
- ide: lateral joins, subqueries with table, hover aliases (#969)
- ide: support table alias with column list (#968)
- linter: fix ignore comment not working with trailing content (#975)
- ide: fix column name infer & related goto def (#977)
- syntax: update ast with missing
detach partitionfields (#978) - ide: fix builtin aggregates being defined as functions (#971)
- ci: fix arm musl build (#966)
- ide: refactor hover to use goto def (#967)
-
linter: undo foreign key constraint check in create table (#962)
This was an incorrect change to add and isn't necessary since the new table doesn't have any rows.
- ci: build for alpine arm (#960)
- ide: code action - rewrite between as binary expression (#953)
- ide: goto def & hover for now() + current_timestamp (#950)
- ide: goto def for column names in table function returns (#949)
- ide: goto def with function in from item & cross join (#961)
- ide: fix col names for collation for, at time zone, overlaps (#951)
- linter: warn about foreign key constraints in create table defs (#945)
- parser: support on conflict do select & sync regression suite (#935)
- parser: improve create function table return type parsing (#944)
- ide: find ref support for builtins (#942)
- ide: support inherits/like tables in inlay hints (#936)
- ide: add quick fixes for leading
from(#933) - ide: goto def for builtins (#932)
- linter: fix adding-not-nullable-field for pg >= 12 with validated CHECK (#910). Thanks @reteps!
- linter: don't report lint errors when syntax error found (#943)
- github: fix commenting via rust_crypto features in jsonwebtoken (#929). Thanks @lokiwins!
-
parser: parse leading from clauses but warn they're not supported (#927)
from t select c;
now gives:
error[syntax-error]: Leading from clauses are not supported in Postgres ββΈ stdin:1:1 β 1 β from t select c; β°β΄ββββββWe also check for solo from clauses:
from t;gives:
error[syntax-error]: Missing select clause ββΈ stdin:1:1 β 1 β from t β°β΄β -
parser: fix parsing any/all/some in exprs (#926)
select * from t order by all
now properly errors:
error[syntax-error]: expected expression in atom_expr ββΈ stdin:1:26 β 1 β select * from t order by all β°β΄ β
Before it parsed
allas a name reference. -
ide: goto def func call in on conflict (#925)
- parser: improve error recovery in
where,having, &joinon(#911, #912) - ide: goto def on conflict clause (#907)
- ide: goto def func calls inside constraints/columns/indexes/partitions (#906)
- ide: goto def with recursive CTEs (#909)
- vscode: add report issue command using the builtin issue reporter (#897)
- ide: goto def on
comment onstmts (#894) - ide: goto def with create table as (#893)
- ide: document symbols for create policy (#892)
- ide: goto def with policy stmts (#886, #887, #888)
- linter: undo ignoring single stmts in prefer-robust-stmts (#902)
- ide: fix goto def for func call inside func (#901)
- docs(readme): bump version of squawk in pre-commit demo v0.10.0 to v2.38.0 (#889). Thanks @dzhalaevd!
- parser: add more nodes for create policy/alter policy ast (#884)
- parser: cte error handling improvements (#881)
- ide: completions for more clauses in select (#883)
- ide: complete * in select clauses (#880)
- ide: improve select completions with completion marker (#879)
- ide: hover support for subquery columns (#878)
- ide: include types in completions (#877)
- ide: goto def with function param in create op (#876)
- ide: goto def support for domains (#872)
- ide: goto def on multiranges & timestamp timezones (#870)
- ide: function signature in completion (#869)
- ide: update cast rewrites to support
select type 'foo'(#868)
- ide: fix column name for real type (#874)
- ide: fix goto def with cte & table of same name (#873)
- parser: fix unicode escape strings being parsed as byte strings (#871)
- ide: fix type alias goto def, bigint -> int8, smallint -> int2, etc. (#867)
- parser: fix parsing cast operator with array type (#866)
- ide: cast function <-> cast operator code actions (#834)
- ide: values <-> select code actions (#846, #847)
- ide: insert schema code action (#855, #856)
- code completion
- ide: delete from completion improvements (#861)
- ide: completion for truncate, table, select (#857)
- ide: code completion in playground & prettier upgrade (#859)
- ide: code completion for schemas (#858)
- many goto def & hover improvements
- ide: goto def for create/alter/drop role (#854)
- ide: create/alter/drop event trigger (#852)
- ide: listen/notify/unlisten (#851)
- ide: goto def with create/drop trigger (#850)
- ide: goto def/hover/document symbol support for prepare stmt (#849)
- ide: add support for declare/fetch/move/close cursor (#848)
- ide: better goto def support for returning clause in insert/update/delete (#828)
- ide: improved goto def & hover for merge stmts (#830)
- ide: goto def/hover for like and inherits clauses (#832)
- ide: goto def nested table/values (#844)
- ide: goto def with column list alias (#843)
- ide: goto def on function using table as type (#842)
- ide: goto def on named params & special functions (#841)
- ide: goto def on extensions (#840)
- ide: inlay hints for select in insert stmt (#845)
- parser: improve error handling for unfinished select stmt (#838)
- playground: expand selection support (#829)
- parser: update role grammar to use refs like names (#853)
- ide: fix default search path to include pg_catalog (#864)
- ide: goto def support for merge (#826),(#825)
- ide: goto def truncate, lock, vacuum, alter table column, refresh (#823)
- ide: document symbol support for create view (#807)
- ide: goto def create/alter/drop server (#821)
- ide: goto def foreign tables (#820)
- ide: use previous token in more cases of punctuation (#819)
- ide: support hover with
*in queries (#818) - ide: goto def support for references column constraints &
select t.* from t;(#817) - ide: support find references for join using clause (#816)
- ide: goto def using clause in join (#815)
- ide: goto def for tablespace (#814)
- ide: better goto def with create table (#813)
- ide: mat view goto def/hover, agg/procedure/mat view doc symbols (#812)
- ide: better goto def support for types (#811)
- ide: composite field goto def & hover (#810)
- ide: document symbol support for CTEs (#806)
- ide: hover for views (#804)
- ide: goto def with create view (#802)
- vscode: restart server command (#808)
- ide: fix column name for special cased functions (#824)
- playground: fix dupe hover results in editor (#805)
- ide: add goto def & hover support for types in casts (#799)
- ide: add initial goto def support for types (#798)
- ide: support ctes with update (#797)
- ide: hover with update (#796)
- ide: goto def with update (#795)
- ide: goto def with insert/delete & CTE (#794)
- ide: goto def for joins (#793)
- ide: goto def & hover with procedures (#792)
- ide: table alias goto def support (#791)
- ide: hover for create aggregate (#789)
- ide: goto def for aggregates (#788)
- ide: cte improvements, subqueries, values, union select (#787)
- ide: code action to remove redundant alias (#785)
- ide: add hover to cte table & columns (#784)
- ide: support more CTEs in goto def (#783)
- ide: goto def with cte & select (#782)
- ide: code action for making inferred column alias explicit (#781)
- playground: inlay hints, doc symbols, hover, goto def/refs, actions (#779)
- ide: add columns to document symbols (#778)
- ide: add document symbols (#777)
- ide: support hover & goto def for function call style columns in where (#776)
- ide: support func call syntax in select (#775)
- ide: support goto def on schema (#774)
- ide: support hover for delete, insert, and select targets (#773)
- ide: goto def & hover tables refs in from clause (#772)
- ide: inlay hints for insert & add goto def for hints (#771)
- ide: goto def for insert and delete (#770)
- ide: inlay hints for function calls (#769)
- ide: function call goto def and hover (#768)
- ide: add hover for create function (#767)
- ide: goto def with create & drop function (#766)
- ide: add hover for create index (#765)
- ide: add hover for create table (#764)
- ide: add hover for column in create index (#763)
- ide: goto def on create/drop index (#762)
- ide: add basic find refs support (#760)
- parser: fix parsing group by all in CTE (#780)
- ide: fix goto def with temp table (#761)
- parser: add support for postgres 19's partition merge, partition split, and more. (#754)
- parser: handle missing exprs in case expr (#749)
- ide: goto def with
tablestmt (#748) - ide: support
set search_path(#747)
- fix: Removed deprecated cargo_bin() function in snapbox (#746). Thanks @ranger-ross!
- ci: try to fix npm trusted publishing (#742)
- ci: npm trusted publishing (#741)
-
ide: goto def create temp table (#737)
-
ide: basic goto def for create table/drop table (#736)
-
ide: goto def on begin/commit/rollback (#734)
-
ide: quote & unquote identifiers (#733)
-
ide: add table <-> select rewrites (#728)
-
ide: string rewrites (#725)
-
parser: update grammar & ast (#727)
-
use npm trusted publishing (#724). Thanks @chdsbd!
- linter: fix false positive with
create temp table t() on commit drop;(#739) - parser: fix reindex parsing (#726)
- parser: fixed issue parsing some
insert's withselects andconflictclauses (#720, #721, #722).
- parser: special case functions like
extractare now properly typed in the ast (#719).
- linter: adding_foreign_key_constraint: allow when create table in transaction (#713)
- lsp: add code action for case else clause (#709). Thanks @cr4ftx!
- lsp: go to def for case exprs (#708)
- parser: fill out more ast nodes (#714)
- parser: add slice expr node to syntax tree (#707)
- parser: improve create function & create foreign table robustness (#704)
- parser: improve option & role lists (#702)
- parser: improve error recovery for update statements (#701)
- parser: fix nodes for casts so ast access works correctly (#711)
- linter: fix autofix for int & smallint with array types (#710)
-
linter: new rule
ban-uncommitted-transactionSquawk now warns about missing
commitstatements like:begin; create table t(id bigint);
warning[ban-uncommitted-transaction]: Transaction never committed or rolled back. ββΈ stdin:1:1 β 1 β begin; β βββββ β β help: Add a `COMMIT` or `ROLLBACK` statement to complete the transaction. ββ΄ 2 Β± 3 + COMMIT; β°β΄
-
parser: improve error recovery for option lists in
reindex,prepare,vacuum,copy,drop database,create type,create function,create table,create index(#684) -
parser: improved error recovery for CTEs (#683)
with a as ( select 1 ) -- <-- missing a comma b as ( select 3 ) select 2;
squawk now identifies the missing comma correctly:
error[syntax-error]: missing comma ββΈ stdin:4:6 β 4 β ) -- <-- missing a comma β°β΄ β -
parser: improve error recovery of group by & distinct on (#695)
-
vscode: improved commenting behavior (#690)
-
linter: fixed false positive with
constraint-missing-not-valid(#694) -
lexer: lex empty dollar quoted strings (
$$$$) correctly (#691) -
linter: identify
tablestatement as fast (#688) -
lsp: server logs no longer contain ansi codes which vscode garbles (#681)
- lsp server: expand selection support. (#674)
- linter: fix require-timeout-settings false positives with
create tablestatements that do not have foreign keys. (#675)
-
New rule: require-timeout-settings (#671)
It's important to configure lock & statement timeouts to ensure safe migrations. See Safety Requirements
So the following will error:
alter table t add column c boolean;
but this is okay:
set lock_timeout = '1s'; set statement_timeout = '5s'; alter table t add column c boolean;
If you've already configured timeouts for your migrations, you can safely ignore this rule.
-
parser: pg18
likeclause increate foreign tablenow parses (#666) -
cli: parsing rule alises i.e., prefer-timestamptz and prefer-timestamp-tz both work. (#668)
-
cli: rendering of diffs for suggestions in output. (#662)
We now include a diff below the rule error.
warning[require-concurrent-index-creation]: During normal index creation, table updates are blocked, but reads are still allowed. ββΈ example.sql:10:1 β 10 β CREATE INDEX "field_name_idx" ON "table_name" ("field_name"); β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β help: Use `concurrently` to avoid blocking writes. ββ΄ 10 β CREATE INDEX concurrently "field_name_idx" ON "table_name" ("field_name"); β°β΄ ++++++++++++
-
parser: parsing some
setrelated commands. (#657)The following now parse:
set schema 'foo'; set foo.bar from current; set bar from current;
- internal: bump rust to 1.90.0 (#659)
- syntax: fill out more of the ast (#658)
-
linter:
adding-field-with-defaultnow allows more cases (#652).alter table t add column c text[] default array[]::text[]; alter table t add column c timestamptz default current_timestamp; -- const/non-volatile binary expressions are also allowed alter table t add column c timestamptz default now() - interval '100 years';
-
parser: parse materialized views using a paren select (#651).
The following now parses:
create materialized view v as (select * from t);
- cli now uses unicode for snippet annotations (#654).
github: fix api calls failing with 403. (#643)
- linter:
--no-error-on-unmatched-patternargument to not exit with an error if no files are matched (default: false) (#639). Thanks @PascalFrenz! - linter: gitlab reporter (#624). Thanks @benedikt-bartscher!
-
linter: adding-field-with-default now checks that the postgres version is
<= 11before reporting an error for non-volatile defaults (#637). Thanks @ermakov-oleg! -
linter: github commenting truncates when too large (#605). Thanks @ienugr!
-
parser: parsing path's named
operatornow works (#640).Previously the following would error:
create table operator();
-
squawk_syntax:
ast::BinExprlhs&rhsproperties now work correctly (#634). -
internal: bumped a bunch of outdated JS & Rust dependencies (#630), (#631), (#632), (#633).
- linter: quick fixes for prefer-text-field (#621), ban-char-field (#620), prefer-bigint-over-int, prefer-bigint-over-small-int (#618), and prefer-timestamptz (#617).
-
Fixed typos in linter docs (#623). Thanks @benedikt-bartscher!
-
linter: fix ban-char-field to be case insensitive (#619).
-
github: support overriding api url for github enterprise usage (#611). Thanks @jvatic!
-
lsp server: quick fix to open documentation for rule violation (#610)
-
lsp server: quick fixes to ignore rules for a line or entire file (#613)
- linter: violations no longer include leading whitespace & comments in their range. (#612)
-
linter: add fixes for prefer-robust-stmts (currently LSP server only) (#602)
-
playground: add quick fix support (#606)
- linter: fix comparison edge cases with identifiers (#600), (#601). Thanks @gilbsgilbs!
- parser: bugged warning for invalid casts that was warning about all casts inside function calls. (#598)
- parser: warn about
try_castand don't fail to parse casts that are invalid. (#593)
- vscode: invalid binary path on windows causing extension not to load. (#595)
-
GitHub annotations when run with
GITHUB_ACTIONSset. (#589), (#590)This can be disabled by setting
SQUAWK_DISABLE_GITHUB_ANNOTATIONS. -
Docs for
squawk-ignore-file. (#588) -
Publishing to open vsx in CI. (#587)
-
linter: file level rule violation ignore comments. (#585)
Now you can ignore all violations in a file via:
-- squawk-ignore-fileor ignore a specific rule for the file:
-- squawk-ignore-file prefer-robust-stmtsThis works with the existing line level ignores:
create table t (id int); -- squawk-ignore prefer-robust-stmts create table u (id int);
-
vscode: incremental sync. (#583)
No more debouncing of file updates making squawk in vscode snappier!
-
vscode: tracing setting
squawk.trace.server& output channel. (#584), (#585)
- vscode:
Show tokenscommand to get lexer output. (#579) - vscode:
Show server&Stop servercommands. (#576) - vscode:
show client logs&show syntax treecommands. (#575)
-
Basic VSCode extension. (#567), (#569), (#571), (#572)
-
Improved
json_tableparsing. (#564)
- Parsing non-standard placeholders with format
:name. (#560), (#561) - Error recovery for
drop tablewhen there's extra commas or missing commas. (#556) - Improved
order byparsing. (#556) - Error recovery for array exprs & improvements for constraints. (#557)
- Improved CTE parsing. (#558)
- Error recovery for type args & more forgiving create table args parsing. (#559)
- Internal: bumped rust to 1.88.0
-
validation for missing types in
create tableargs. (#550)The following now parses with an error:
create table t ( x int, description );
error[syntax-error]: Missing column type --> stdin:3:14 | 3 | description | ^ | -
Make
alter tableactions robust to missing commas. (#549)The following now parses with an error:
alter table t validate constraint foo validate constraint b;
error[syntax-error]: missing comma --> stdin:2:26 | 2 | validate constraint foo | ^ |
-
Crash with trailing comma in select target list. (#551)
The following now parses with an error:
select a, from t;
error[syntax-error]: unexpected trailing comma --> stdin:1:9 | 1 | select a, from t; | ^ | -
Parsing idents with
uescape. (#533)The following now parses:
select U&"d!0061t!+000061" UESCAPE '!';
- The npm install script now checks an env var (
SQUAWK_LOCAL_CDNURL), that defaults tohttps://github.com/sbdchd/squawk/releases/download, for downloading binaries. This should help when you want to use a cache or in case GitHub is down.
-
The last of the pg regression suite errors. (#543), (#542)
-
Precendence when parsing compound select statements. (#544)
SELECT foo UNION SELECT bar ORDER BY baz; -- equal to: (SELECT foo UNION SELECT bar) ORDER BY baz;
-
parsing compound select statements & their trailing clauses, i.e. (#539)
(select 1) limit 1; select * from ( (select 1) union all (select 1) );
-
join parsing to be more error resilent: (#538)
error[syntax-error]: Join missing condition. --> stdin:2:23 | 2 | select * from t join u; | ^ | error[syntax-error]: Join `using` clause is not allowed for cross joins. --> stdin:16:30 | 16 | select * from t cross join u using (id); | ^^^^^^^^^^ | error[syntax-error]: Join condition is not allowed for cross joins. --> stdin:18:30 | 18 | select * from t cross join u on true; | ^^^^^^^ |
- Relicensed: gpl3 -> apache or mit (#534)
json_table,table,values,group by(#536)- Cast expression issues (#533)
- Float lexing (#532)
- Unicode escaped quoted idents (#531)
xmltable(#530)- Many parser fixes for the pg regression test suite (#529), (#527), (#526), (#524), (#523), (#522)
-
Fix regression in linter rule
adding-not-nullable-fieldfrom v2 rewrite. It wasn't erroring when it should have. (#520) -
Fix parser panic related to
select json_array(select from t);(#515) -
Fix more parser errors in PG regression suite.
notnullnow parses! (#516) -
Fix more parser errors in PG regression suite part 2. Notably
ilikeis now supported. (#518)
-
Fix typo in rule name parsing causing
unused-ignoreto warn forprefer-timestamp-tz. (#511) -
Fix parsing window definition. (#510)
Previously the following would error:
WITH ranked_notifications AS ( SELECT notification_id, ROW_NUMBER() OVER ( PARTITION BY user_id, board_id ORDER BY created_at DESC ) AS rn FROM public.notification WHERE android_channel_id = 'watchlist' ) UPDATE public.notification SET dismissed_at = current_timestamp WHERE notification_id IN ( SELECT notification_id FROM ranked_notifications WHERE rn > 1 );
- Added back basic dump ast support via
squawk --debug=ast. (#505)
-
Fix parsing
select select. (#499)Previously, the following would panic:
select select
-
Fix displaying warnings as errors. (#502)
We were highlighting warnings using the error syntax (red
^instead of yellow-). We also were rendering syntax errors as warnings instead of errors! -
Fix parsing aggregate args with modifiers like
distinctorall. (#498) Thanks @psteinroe!Previously the following would error:
select string_agg(distinct c, ',') filter (where length(c) > 1) from t;
-
Fix parsing data sources within params. (#497) Thanks @psteinroe!
Previously the following would error:
select f1, count(*) from t1 x(x0,x1) left join (t1 left join t2 using(f1)) on (x0 = 0)
-
Fix parsing alternative boolean keywords. (#493) Thanks @psteinroe!
Previously the following would error:
explain (costs off) select;
- Renamed
ast::Itemtoast::Stmt. (#483) - Split
selectintoselect,tables, andvaluesstatements. (#484)
-
Fix parsing table constraint foreign key actions. (#480)
Previously, the following would error:
alter table foo add constraint foo_bar_id_fkey foreign key (bar_id) references bar (id) on update cascade on delete cascade;
- Fix the GitHub commenting overwriting comments made by other bots sharing the same name, i.e., the default GitHub Action bot. (#477) Thanks @danxmoran!
-
Fixed parsing
create or replace view(#474).Previously, the following would error:
create or replace view my_view as select x from foo;
- Fixed parsing
create viewwith nested parens (#468).
-
Parsing
grantandrevokestatements with schema specified names, aka the following parses correctly: (#469)GRANT ALL ON SEQUENCE public.s TO u;
- Style guide for linter error messages
-
Error messages for
prefer-robust-statementsto be less confusing. We were saying to addif not existsevery time, even when the statement didn't have that option. -
Fixed parsing nested compound select that has parens (#464). The following now parses:
SELECT ( (SELECT id FROM code_categories WHERE "language" = @language::char(4) ORDER BY "id" ASC LIMIT 1) UNION (SELECT id FROM code_categories WHERE "language" = 'nl-NL' ORDER BY "id" ASC LIMIT 1) ) LIMIT 1;
ban-truncate-cascaderule (#453)
- Ignore comments to disable a rule inline.
- Fancier lint violation formatting in the terminal using annotate-snippets.
- WASM powered playground to run Squawk locally in the browser.
- New parser with error recovery -- it doesn't fail if you're missing a comma, semicolon, etc! This also means we've removed the dependency on libpg_query.
- Dockerfile to run Squawk in a container (#422). Thanks @alphayax!
prefer-big-intrule, which has been deprecated in favor ofprefer-bigint-over-intandprefer-bigint-over-smallintfor a while now.
- Fixed panic when formatting violations (#426).
- Added
ban-alter-domain-with-add-constraintandban-create-domain-with-constraint(#418). Thanks @johnmastro!
- Fixed adding-not-nullable-field incorrectly failing to check for nulls (#412). Thanks @schew2381!
- Fixed building macOS Python wheels for x86 (#406). Thanks @ermakov-oleg!
- Bump package version to set latest (#404).
- Fixed accidental glibc upgrade (#401).
- Fixed support for custom LIBPG_QUERY_PATH (#399).
- Added warning to
adding-field-with-defaultto warn about generated columns (#397).
- Fixed bug in
adding-required-fieldwhere generated columns were incorrectly flagged (#397).
- fix
start transactionsupport (#386). Thanks @bmbferreira!
- added support for linux arm64 builds (#382).
- Add file violation count to summary report output (#378). Thanks @ermakov-oleg!
- added support windows builds (#368). Thanks @ermakov-oleg!
- improved docs for "disallowed-unique-constraint" (#370). Thanks @teeyingyap!
- fixed "prefer-robust-stmts" to work with RLS (#367)
- fix install for darwin-x86 (#361)
- fix build for macos arm64 (#356)
- support configuration for "fail_on_violations" via
upload_to_github.fail_on_violations(#353) - support root flags within upload-to-github subcommand (#353)
- provided paths now support glob matching.
squawk 'migrations/*.sql'(#352)
- added
--excluded-pathsflag andexcluded_paths = ["example.sql"]configuration option to ignore paths when searching for files (#350). Thanks @rdaniels6813!
- add exceptions for
ban-concurrent-index-creation-in-transactionto handle golang-migrate. Thanks @janrueth! (#339) - improve
disallowed-unique-constraintto handlealter table...add column... unique. (#337)
- added
ban-concurrent-index-creation-in-transactionrule. Thanks @alixlahuec! (#335)
squawk upload-to-githubwill always leave a pull request comment if files are evaluated. Previously if violations were resolved, stale warnings would be left in a comment. (#330)
- added
squawk upload-to-github --fail-on-violationsflag to exit with error if violations are found (#327). Thanks @wmartins!
- support parsing
alter database refresh collationstatements (#324)
- support parsing
alter table setstatements (#321)
- added
transaction-nestingrule. Thanks @andrewsmith! (#303) - added
adding-required-fieldrule fromadding-not-nullable-field. Thanks @andrewsmith! (#301)
- functionality in
adding-not-nullable-fieldfor adding non-nullable fields was moved intoadding-required-field. Thanks @andrewsmith! (#301)
- Only read from stdin when file paths are not provided. (#295)
- added
ban-drop-tablerule. Thanks @borisrozumnuk! (#286) - added
not-null-constraintrule. Thanks @andrewsmith! (#288)
- Fixed building Squawk on platforms where
c_charis unsigned. Thanks @ods! (#285) - Fixed Squawk compatiblity with Nix. Thanks @andrewsmith! (#287)
- Fixed regression in parsing union queries. Fixed parsing call statement. (#293)
- Upgrade libpg_query from 13 to 15. Thanks @andrewsmith! (#291)
- Better support non-volatile defaults for
adding-field-with-default. (#278) - Static link for openssl and glibc. (#283)
- added
prefer-bigint-over-intandprefer-bigint-over-smallintto replaceprefer-big-int. Thanks @aldenquimby! (#273)
- Support TableLikeClause in table creation. Thanks @qoelet! (#271)
- Recognize most DROP statements within a transaction as robust. Thanks @andrewsmith! (#276)
- added
--assume-in-transactionflag and configuration option to indicate that each SQL file is wrapped in a transaction by an external tool. Thanks @andrewsmith! (#264)
- error parsing multiple transactions in one file (#259)
- added better error handling of invalid syntax. (#245)
- added
prefer-big-intrule to prefer 64 bit types over 32 bit types. (#238) - added
prefer-identityrule to preferidentitycolumns overserialcolumns. (#243)
- added
prefer-timestamptzrule to warn about usingtimestampinstead oftimestamptz. (#230)
- only apply
prefer-robust-stmtsto files with more than one SQL statement. (#231)
- catch another way to add foreign keys for
adding-foreign-key-constraint. Thanks @adamrdavid! (#228)
- added
pg_versionconfiguration option to support ignoring rules by Postgres version. Thanks @adamrdavid! (#219)
- internal: use rule IDs based on serde annotations of
RuleViolationKind. (#218)
- fix parsing enum values from configuration file. (#217)
- added validation for configured rules. (#216)
- Change help menu value names. (#216)
- added configuration file (
.squawk.toml) to specify excluded rules. (#213)
- incorrectly silenced stdin
- silence stdin if it's empty (#210)
- duplicate messages being written when using GitHub Actions token authentication. (#209)
- Support GitHub API authentication via GitHub Actions tokens. (#207)
- differentiate between
VOLATILEand non-VOLATILEdefaults inadding-field-with-defaultdocumentation (#201)
- require-concurrent-index-deletion rule and removed deletion warnings from require-concurrency-index-creation. Thanks @K-Phoen! (#177)
- errors parsing PG12 and later query syntax by upgrading to PG13 parser (#174)
- parsing alter constraint statement (#173)
- copy pasta of rename-table into the ban-drop-column rule (#168)
- parsing an index without a name specified (#169)
- false positives with disallowed-unique-constraint and adding-serial-primary-key-field. Thanks @qoelet! (#161)
- false positives with require-concurrent-index rule (#157)
- incorrect internal schema for "alter table" statements with function calls. Thanks @qoelet! (#154)
- incorrect internal schema for "create partition" statements. (#146)
upload-to-githubcommand not obeying top level--excludes. (#142)
- allowing adding not null column with default for
adding-not-null-field. (#144)
- link to website for tty reporter when there are lint errors. (#120)
DROP INDEXsupport for "require-concurrent-index-creation" and "prefer-robust-stmts". (#124)- github comment now includes Squawk's version number. (#131)
- new
ban-drop-columnrule (#132)
- updated "adding-not-null-field" to warn about making a column non-nullable with
NOT NULL. See the "adding-not-null-field" docs for more information. (#101)
- false positive with
prefer-text-fieldthat wasn't allowingvarcharwithout a length specified
- added "debug" option for
--dump-astto print out tree using Rust'sDebugformatter (#92) - added new rule, "adding-foreign-key-constraint", to provide suggestions for safely adding foreign key constraints (#91)
- updated "robust-stmts" suggestions with caveat about
IF NOT EXISTS(#95) - updated "constraint-missing-not-valid" to warn about adding a constraint as NOT VALID and then using "VALIDATE CONSTRAINT" in the same transaction (#97)
- updated "prefer-robust-stmts" with exception for using
DROP CONSTRAINT IF EXISTSbeforeADD CONSTRAINT(#99)
- error reporting is more user friendly (#89, #90)
- parsing of RangeVar with missing inh field
- parsing of alter table with type cast
- parsing of create table with primary key constraint on two fields
- run
prefer-text-fieldon alter table statments
- new rule
adding-primary-key-field
- parsing
->>operator
- parse function calls in alter table statements
- new rule
ban-char-type
- upload-to-github comment formatting to hopefully be more clear
- docs on crates.io for sub crates
- new rule
prefer-robust-stmts
- upload-to-github commenting on PRs when no files provided (#30)
- remove
SQUAWK_GITHUB_BOT_NAMEenv var for github upload, no longer needed (#27)
- false positive in unique constraint rule (#28)
- logging, mainly around upload-to-github (#24)
--stdin-filepathargument (#23)- output a success message for CLI tty reporter (#22)
- prefix env vars with SQUAWK_ (#21)
- error level HTTP status codes not being errors (#20)
upload-to-githubsubcommand for outputing squawk results in a GitHub PR comment.- print help menu when no options provided
- automatically detect stdin instead of using the
-path
- off by one error in slicing problem SQL for the tty reporter
- documentation for rules
- release binaries
- CI
- Initial release