diff --git a/CHANGELOG.md b/CHANGELOG.md index 79418239..cb90e67e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,69 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## v2.48.0 - 2026-04-18 + +### Added + +- 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 + `--include` flag. + + ```sql + -- 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: + + ```sql + -- 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 `b` in `t.b` as a function: + + ```sql + 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) + +### Fixed + +- parser: fix param parsing (#1068) + + Before, `double precision` was parsed as a param named `double` with type `precision`. + Now it's parsed correctly as an unnamed param of type `double precision`. + + ```sql + create function f(double precision) returns int8 + as 'select $1' + language sql; + ``` + ## v2.47.0 - 2026-04-13 ### Added diff --git a/Cargo.lock b/Cargo.lock index 83e0d16a..828fa4ae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2385,7 +2385,7 @@ dependencies = [ [[package]] name = "squawk" -version = "2.47.0" +version = "2.48.0" dependencies = [ "annotate-snippets", "anyhow", @@ -2415,7 +2415,7 @@ dependencies = [ [[package]] name = "squawk-fmt" -version = "2.47.0" +version = "2.48.0" dependencies = [ "insta", "itertools", @@ -2425,7 +2425,7 @@ dependencies = [ [[package]] name = "squawk-github" -version = "2.47.0" +version = "2.48.0" dependencies = [ "jsonwebtoken", "log", @@ -2436,7 +2436,7 @@ dependencies = [ [[package]] name = "squawk-ide" -version = "2.47.0" +version = "2.48.0" dependencies = [ "annotate-snippets", "etcetera", @@ -2458,14 +2458,14 @@ dependencies = [ [[package]] name = "squawk-lexer" -version = "2.47.0" +version = "2.48.0" dependencies = [ "insta", ] [[package]] name = "squawk-linter" -version = "2.47.0" +version = "2.48.0" dependencies = [ "annotate-snippets", "enum-iterator", @@ -2480,7 +2480,7 @@ dependencies = [ [[package]] name = "squawk-parser" -version = "2.47.0" +version = "2.48.0" dependencies = [ "annotate-snippets", "camino", @@ -2493,7 +2493,7 @@ dependencies = [ [[package]] name = "squawk-server" -version = "2.47.0" +version = "2.48.0" dependencies = [ "anyhow", "crossbeam-channel", @@ -2519,7 +2519,7 @@ dependencies = [ [[package]] name = "squawk-syntax" -version = "2.47.0" +version = "2.48.0" dependencies = [ "annotate-snippets", "camino", @@ -2532,7 +2532,7 @@ dependencies = [ [[package]] name = "squawk-thread" -version = "2.47.0" +version = "2.48.0" dependencies = [ "crossbeam-channel", "crossbeam-utils", @@ -2544,7 +2544,7 @@ dependencies = [ [[package]] name = "squawk-wasm" -version = "2.47.0" +version = "2.48.0" dependencies = [ "console_error_panic_hook", "console_log", @@ -3420,7 +3420,7 @@ checksum = "32ac00cd3f8ec9c1d33fb3e7958a82df6989c42d747bd326c822b1d625283547" [[package]] name = "xtask" -version = "2.47.0" +version = "2.48.0" dependencies = [ "anyhow", "camino", diff --git a/Cargo.toml b/Cargo.toml index 4e15617b..8dbbeaf6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ members = ["crates/*"] resolver = "2" [workspace.package] -version = "2.47.0" +version = "2.48.0" edition = "2024" rust-version = "1.94" authors = ["Squawk Team & Contributors"] @@ -72,14 +72,14 @@ rustc-hash = "2.1.1" # local # we have to make the versions explicit otherwise `cargo publish` won't work -squawk-github = { path = "./crates/squawk_github", version = "2.47.0" } -squawk-ide = { path = "./crates/squawk_ide", version = "2.47.0" } -squawk-lexer = { path = "./crates/squawk_lexer", version = "2.47.0" } -squawk-parser = { path = "./crates/squawk_parser", version = "2.47.0" } -squawk-syntax = { path = "./crates/squawk_syntax", version = "2.47.0" } -squawk-linter = { path = "./crates/squawk_linter", version = "2.47.0" } -squawk-server = { path = "./crates/squawk_server", version = "2.47.0" } -squawk-thread = { path = "./crates/squawk_thread", version = "2.47.0" } +squawk-github = { path = "./crates/squawk_github", version = "2.48.0" } +squawk-ide = { path = "./crates/squawk_ide", version = "2.48.0" } +squawk-lexer = { path = "./crates/squawk_lexer", version = "2.48.0" } +squawk-parser = { path = "./crates/squawk_parser", version = "2.48.0" } +squawk-syntax = { path = "./crates/squawk_syntax", version = "2.48.0" } +squawk-linter = { path = "./crates/squawk_linter", version = "2.48.0" } +squawk-server = { path = "./crates/squawk_server", version = "2.48.0" } +squawk-thread = { path = "./crates/squawk_thread", version = "2.48.0" } [workspace.lints.clippy] collapsible_else_if = "allow" diff --git a/README.md b/README.md index be6b3b5b..cbee69b7 100644 --- a/README.md +++ b/README.md @@ -265,7 +265,7 @@ to your project's `.pre-commit-config.yaml`: ```yaml repos: - repo: https://github.com/sbdchd/squawk - rev: 2.47.0 + rev: 2.48.0 hooks: - id: squawk files: path/to/postgres/migrations/written/in/sql diff --git a/crates/squawk_github/src/app.rs b/crates/squawk_github/src/app.rs index 1d70c1b8..135cb1c4 100644 --- a/crates/squawk_github/src/app.rs +++ b/crates/squawk_github/src/app.rs @@ -11,7 +11,7 @@ use serde_json::Value; use std::time::Duration; use std::time::{SystemTime, UNIX_EPOCH}; -pub(crate) const SQUAWK_USER_AGENT: &str = "squawk/2.47.0"; +pub(crate) const SQUAWK_USER_AGENT: &str = "squawk/2.48.0"; #[derive(Debug, Serialize)] struct CommentBody { diff --git a/flake.nix b/flake.nix index 33811307..04682711 100644 --- a/flake.nix +++ b/flake.nix @@ -18,7 +18,7 @@ { squawk = final.rustPlatform.buildRustPackage { pname = "squawk"; - version = "2.47.0"; + version = "2.48.0"; cargoLock = { lockFile = ./Cargo.lock; diff --git a/package.json b/package.json index 89fdb7a9..a134fb59 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "squawk-cli", - "version": "2.47.0", + "version": "2.48.0", "description": "linter for PostgreSQL, focused on migrations", "repository": "git@github.com:sbdchd/squawk.git", "author": "Squawk Team & Contributors", diff --git a/squawk-vscode/package.json b/squawk-vscode/package.json index 557f25c1..2019e053 100644 --- a/squawk-vscode/package.json +++ b/squawk-vscode/package.json @@ -12,7 +12,7 @@ "icon": "icon.png", "author": "Squawk Team & Contributors", "license": "(Apache-2.0 OR MIT)", - "version": "2.47.0", + "version": "2.48.0", "engines": { "vscode": "^1.101.0" },