Skip to content

void db execute --remote --file passes file contents through argv, causing large files to fail #863

Open

Description

@karthickeyan-dev

Void 1.10.0 reads the entire SQL file and includes its contents in one JSON command argument passed to a child process. Large files exceed the operating system's argument-size limit.

To reproduce in a project configured for remote D1, create a large SQL file:

python3 - <<'PY'
from pathlib import Path
Path("large.sql").write_text(
    "/*" + "x" * (2 * 1024 * 1024) + "*/\nSELECT 1 AS value;\n"
)
PY

Then run:

pnpm exec void db execute --remote --file large.sql

Expected: File execution uses a transport that avoids command-line argument limits.

Actual: The child process cannot start because the SQL contents exceed the argument-size limit, producing spawnSync … E2BIG.

The installed code follows this path:

  • runExecute() reads the entire file.
  • executeCloudflareD1Sql() puts the SQL into a d1.execute operation.
  • encodeCloudflareOperation() serializes the operation into one command argument.
  • createCloudflareProcessRunner() passes it to spawnSync().

Verification: Tested the installed 1.10.0 process runner with its child replaced by a harmless local Node process. A small payload succeeded; a 2 MB payload failed with E2BIG. No remote database operation was run.

Could file execution use a file-import transport instead of passing the SQL contents through command arguments?

Environment: Void 1.10.0, Node 26.13.1, macOS.

Activity

  1. self-assigned this
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions