Skip to content

feat: add prepared statements support #3245

@krasnovdm

Description

@krasnovdm

Currently, the Embedded UI does not support executing parameterized queries (prepared statements). Users can only execute queries with hardcoded values, which makes it difficult to debug, test, and reproduce code behavior within the UI. This limitation is especially problematic when trying to simulate or debug code that relies on prepared queries with parameters, since the UI does not allow passing parameter values directly.

Currently, users have to hardcode the parameter values inside the query text, which changes the semantics and potentially the execution plan. This is not how queries are executed in code (SDK), leading to discrepancies and making troubleshooting harder.

Proposed Solution

  • Add support for inputting and submitting query parameter values directly in the Embedded UI.
  • Allow users to define parameter names and their values via UI form or sidebar before running a query.
  • Ensure the backend executes the query as a real prepared statement, matching SDK/code execution logic.

Benefits

  • Makes debugging and reproducing code issues easier.
  • Reduces discrepancies between code behavior and UI behavior.
  • Enables users to more effectively test and optimize parameterized queries.
  • Prevents accidental changes to execution plans due to constant folding.
  • Additional Context

Related discussion:

  • Different query plans for parameterized vs hardcoded queries noticed in both Embedded UI and code.
  • Consistency with code execution is important for troubleshooting and performance analysis.

Arcadia CI 6781

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions