Skip to content

rust: reject multiple statements in one declared SQL file #968

Closed

Description

@athvin

Evidence

Full and partial analysis remove and inspect only the first parsed statement. parse_and_plan does the same, while generated functions retain the complete SQL text. A second statement bypasses static checks. Source.

Change

Require exactly one parsed statement at the declared-SQL boundary and in parse_and_plan.

Done when

  • A valid first statement followed by an invalid second statement fails both full and partial analysis.
  • The public planner refuses multiple statements.
  • One-statement files continue to plan and emit unchanged.

Activity

  1. added
    code-cleanup
    on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    code-cleanup

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions