Menu
Squawk LogoSquawkDocsRules
PlaygroundQuick StartGitHub
Squawk LogoSquawk
  • Docs
  • Rules
  • Playground
  • Quick Start
  • GitHub
  • General
    • Quick Start
    • Applying migrations safely
    • CLI
    • GitHub Integration
    • Web Frameworks
    • Postgres locks and further reading
    • Troubleshooting
  • Rules
    • Rules Overview
    • adding-field-with-default
    • adding-foreign-key-constraint
    • adding-not-nullable-field
    • adding-required-field
    • adding-serial-primary-key-field
    • ban-char-field
    • ban-concurrent-index-creation-in-transaction
    • ban-drop-column
    • ban-drop-database
    • ban-drop-not-null
    • ban-drop-table
    • changing-column-type
    • constraint-missing-not-valid
    • disallowed-unique-constraint
    • prefer-bigint-over-int
    • prefer-bigint-over-smallint
    • prefer-identity
    • prefer-robust-stmts
    • prefer-text-field
    • prefer-timestamptz
    • renaming-column
    • renaming-table
    • require-concurrent-index-creation
    • require-concurrent-index-deletion
    • transaction-nesting
    • ban-create-domain-with-constraint
    • ban-alter-domain-with-add-constraint
    • ban-truncate-cascade
    • syntax-error

syntax-error

problem#

Squawk encountered invalid syntax when parsing.

examples#

trailing comma

select f(1,2,);
-- error[syntax-error]: unexpected trailing comma
-- --> stdin:1:13
-- |
-- 1 | select f(1,2,);
-- | ^
-- |

missing semicolon

select * from t
select id from users where email = email;
-- error[syntax-error]: expected SEMICOLON
-- --> stdin:1:16
-- |
-- 1 | select * from t
-- | ^
-- |

solutions#

Fix the syntax error.

note

Squawk might be mistaken, if you think that's the case, please open an issue!

Edit this page
Previous
« ban-truncate-cascade
  • problem
  • examples
  • solutions

Docs

  • Quick Start
  • Rules

More

  • GitHub
  • Changelog
  • Help
Copyright © 2025 Squawk Authors.