Skip to content

cloud service query --queries-file rejects multi-statement files that local client --queries-file accepts #333

Description

@sdairs

Found during 0.4.0 RC cloud-command testing (2026-07-30).

A queries file with more than one statement works with local client --queries-file but fails through cloud service query --queries-file:

$ cat queries.sql
SELECT 1;
SELECT 2;
$ chctl cloud service query --id <id> --queries-file queries.sql
Error: {"error":{"code":"62","details":"Syntax error (Multi-statements are not allowed): failed at position 9 (end of query) (line 1, col 9): ;\nSELECT 2. . "}}
(exit 1)

The Query API rejects multi-statement requests and the CLI sends the whole file as a single request. A single-statement file (and stdin via --queries-file -) works fine.

Options, in preference order:

  1. Split the file into statements client-side and send them sequentially (matching local client --queries-file semantics — same flag, same behavior).
  2. Failing that, document the single-statement limitation in the service query help and detect the case early with a friendly error instead of the raw API blob.

Error rendering for this path is also poor — tracked separately.

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