diff --git a/CHANGELOG.md b/CHANGELOG.md index 98d89cd8..ae0e4ebb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,82 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## v2.52.0 - 2026-05-12 + +### Added + +- parser: validation for bit, byte, and escape string types (#1132) + + ```sql + select b'01' '10'; + select x'0F' '10'; + select e'foo' 'bar'; + ``` + + now gives: + + ```sql + 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) + + ```sql + select U&'wrong: !061' UESCAPE '!'; + select U&"wrong: \06" UESCAPE '\'; + ``` + + now gives: + + ```sql + 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) + + ```sql + select 2::U&"!0069!006E!0074!0038" UESCAPE '!' from t; + ``` + + now parses without error + ## v2.51.0 - 2026-05-06 ### Added diff --git a/Cargo.lock b/Cargo.lock index af972a9b..c2d60d59 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2434,7 +2434,7 @@ dependencies = [ [[package]] name = "squawk" -version = "2.51.0" +version = "2.52.0" dependencies = [ "annotate-snippets", "anyhow", @@ -2465,7 +2465,7 @@ dependencies = [ [[package]] name = "squawk-fmt" -version = "2.51.0" +version = "2.52.0" dependencies = [ "anyhow", "camino", @@ -2481,7 +2481,7 @@ dependencies = [ [[package]] name = "squawk-github" -version = "2.51.0" +version = "2.52.0" dependencies = [ "jsonwebtoken", "log", @@ -2492,7 +2492,7 @@ dependencies = [ [[package]] name = "squawk-ide" -version = "2.51.0" +version = "2.52.0" dependencies = [ "annotate-snippets", "etcetera", @@ -2514,14 +2514,14 @@ dependencies = [ [[package]] name = "squawk-lexer" -version = "2.51.0" +version = "2.52.0" dependencies = [ "insta", ] [[package]] name = "squawk-linter" -version = "2.51.0" +version = "2.52.0" dependencies = [ "annotate-snippets", "enum-iterator", @@ -2536,7 +2536,7 @@ dependencies = [ [[package]] name = "squawk-parser" -version = "2.51.0" +version = "2.52.0" dependencies = [ "annotate-snippets", "camino", @@ -2549,7 +2549,7 @@ dependencies = [ [[package]] name = "squawk-server" -version = "2.51.0" +version = "2.52.0" dependencies = [ "anyhow", "crossbeam-channel", @@ -2575,7 +2575,7 @@ dependencies = [ [[package]] name = "squawk-syntax" -version = "2.51.0" +version = "2.52.0" dependencies = [ "annotate-snippets", "camino", @@ -2589,7 +2589,7 @@ dependencies = [ [[package]] name = "squawk-thread" -version = "2.51.0" +version = "2.52.0" dependencies = [ "crossbeam-channel", "crossbeam-utils", @@ -2601,7 +2601,7 @@ dependencies = [ [[package]] name = "squawk-wasm" -version = "2.51.0" +version = "2.52.0" dependencies = [ "console_error_panic_hook", "console_log", @@ -3477,7 +3477,7 @@ checksum = "32ac00cd3f8ec9c1d33fb3e7958a82df6989c42d747bd326c822b1d625283547" [[package]] name = "xtask" -version = "2.51.0" +version = "2.52.0" dependencies = [ "anyhow", "camino", diff --git a/Cargo.toml b/Cargo.toml index 16fa49dd..469dd238 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ members = ["crates/*"] resolver = "2" [workspace.package] -version = "2.51.0" +version = "2.52.0" edition = "2024" rust-version = "1.94" authors = ["Squawk Team & Contributors"] @@ -79,14 +79,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.51.0" } -squawk-ide = { path = "./crates/squawk_ide", version = "2.51.0" } -squawk-lexer = { path = "./crates/squawk_lexer", version = "2.51.0" } -squawk-parser = { path = "./crates/squawk_parser", version = "2.51.0" } -squawk-syntax = { path = "./crates/squawk_syntax", version = "2.51.0" } -squawk-linter = { path = "./crates/squawk_linter", version = "2.51.0" } -squawk-server = { path = "./crates/squawk_server", version = "2.51.0" } -squawk-thread = { path = "./crates/squawk_thread", version = "2.51.0" } +squawk-github = { path = "./crates/squawk_github", version = "2.52.0" } +squawk-ide = { path = "./crates/squawk_ide", version = "2.52.0" } +squawk-lexer = { path = "./crates/squawk_lexer", version = "2.52.0" } +squawk-parser = { path = "./crates/squawk_parser", version = "2.52.0" } +squawk-syntax = { path = "./crates/squawk_syntax", version = "2.52.0" } +squawk-linter = { path = "./crates/squawk_linter", version = "2.52.0" } +squawk-server = { path = "./crates/squawk_server", version = "2.52.0" } +squawk-thread = { path = "./crates/squawk_thread", version = "2.52.0" } [workspace.lints.clippy] collapsible_else_if = "allow" diff --git a/README.md b/README.md index 2d5ca37a..961b26d4 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.51.0 + rev: 2.52.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 3118e396..a2f55568 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.51.0"; +pub(crate) const SQUAWK_USER_AGENT: &str = "squawk/2.52.0"; #[derive(Debug, Serialize)] struct CommentBody { diff --git a/flake.nix b/flake.nix index 952bcc3b..94858eb5 100644 --- a/flake.nix +++ b/flake.nix @@ -18,7 +18,7 @@ { squawk = final.rustPlatform.buildRustPackage { pname = "squawk"; - version = "2.51.0"; + version = "2.52.0"; cargoLock = { lockFile = ./Cargo.lock; diff --git a/npm/darwin-arm64/package.json b/npm/darwin-arm64/package.json index 73563b11..01a93697 100644 --- a/npm/darwin-arm64/package.json +++ b/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@squawk-cli/darwin-arm64", - "version": "0.0.0", + "version": "2.52.0", "description": "squawk-cli binary for darwin-arm64", "repository": "git@github.com:sbdchd/squawk.git", "license": "(Apache-2.0 OR MIT)", diff --git a/npm/darwin-x64/package.json b/npm/darwin-x64/package.json index e7dbd14f..9996afb8 100644 --- a/npm/darwin-x64/package.json +++ b/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@squawk-cli/darwin-x64", - "version": "0.0.0", + "version": "2.52.0", "description": "squawk-cli binary for darwin-x64", "repository": "git@github.com:sbdchd/squawk.git", "license": "(Apache-2.0 OR MIT)", diff --git a/npm/linux-arm64/package.json b/npm/linux-arm64/package.json index 970027e5..b6eda1ca 100644 --- a/npm/linux-arm64/package.json +++ b/npm/linux-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@squawk-cli/linux-arm64", - "version": "0.0.0", + "version": "2.52.0", "description": "squawk-cli binary for linux-arm64", "repository": "git@github.com:sbdchd/squawk.git", "license": "(Apache-2.0 OR MIT)", diff --git a/npm/linux-x64/package.json b/npm/linux-x64/package.json index 9f3b04aa..1dd6b280 100644 --- a/npm/linux-x64/package.json +++ b/npm/linux-x64/package.json @@ -1,6 +1,6 @@ { "name": "@squawk-cli/linux-x64", - "version": "0.0.0", + "version": "2.52.0", "description": "squawk-cli binary for linux-x64", "repository": "git@github.com:sbdchd/squawk.git", "license": "(Apache-2.0 OR MIT)", diff --git a/npm/win32-x64/package.json b/npm/win32-x64/package.json index 03429a0b..5d2679e7 100644 --- a/npm/win32-x64/package.json +++ b/npm/win32-x64/package.json @@ -1,6 +1,6 @@ { "name": "@squawk-cli/win32-x64", - "version": "0.0.0", + "version": "2.52.0", "description": "squawk-cli binary for win32-x64", "repository": "git@github.com:sbdchd/squawk.git", "license": "(Apache-2.0 OR MIT)", diff --git a/package.json b/package.json index d359aa61..c834e88e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "squawk-cli", - "version": "2.51.0", + "version": "2.52.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 adaf35ec..720c4e9c 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.51.0", + "version": "2.52.0", "engines": { "vscode": "^1.101.0" },