Skip to content

fix(deploy): pass cf --sql and --message as single argv values - #570

Open
davidgustys wants to merge 1 commit into
voidzero-dev:mainfrom
davidgustys:fix/cf-single-argv-values
Open

davidgustys wants to merge 1 commit into
voidzero-dev:mainfrom
davidgustys:fix/cf-single-argv-values

Conversation

@davidgustys

@davidgustys davidgustys commented Oct 23, 2026 •

Copy link
Copy Markdown

void db execute --remote --file <file> fails when the file starts with a -- comment. Void passes the SQL to cf d1 query as two argv items, --sql and the SQL itself, so cf reads SQL that starts with - as another flag and stops with Unknown argument: leading comment.

To reproduce, in a project with a remote D1 database:

-- leading comment
SELECT 1;
void db execute --remote --file commented.sql

The SQL and the version upload and deploy messages are now passed as one argv item each (--sql=<sql>, --message=<message>), so a leading - stays part of the value. Void's own deploy messages start with void: today; the message change keeps those call sites consistent.

  • New regression test in cloudflare-operation-process.test.ts. It fails on main with Unknown argument: leading comment and passes with the fix. cf-version-runner.test.ts is updated for the new argv shape.
  • Focused tests pass (141), as do vp run check, vp fmt, vp lint and vp run test --base main. The only failing files in the affected run are the init, init-install and nitro tests, which fail the same way on main locally.

`cf d1 query --sql <value>` read SQL that starts with a comment
(`-- ...`) as a flag, so seed files with a leading comment failed.
Pass `--sql=<value>` and `--message=<value>` as one argument each so a
value that starts with "-" is never parsed as an option.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant