Skip to content

test(cloudflare): reproduce numeric D1 local bind failure#828

Closed
jackbisceglia wants to merge 4 commits into
alchemy-run:claude/alchemy-actions-local-bindings-825ac1from
jackbisceglia:jackbisceglia/repro-d1-local-number-bind
Closed

test(cloudflare): reproduce numeric D1 local bind failure#828
jackbisceglia wants to merge 4 commits into
alchemy-run:claude/alchemy-actions-local-bindings-825ac1from
jackbisceglia:jackbisceglia/repro-d1-local-number-bind

Conversation

@jackbisceglia

@jackbisceglia jackbisceglia commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a dedicated provider test for numeric prepared-statement parameters in QueryDatabaseLocal
  • use SELECT ? AS value so the failure is isolated from table schema and seed behavior

Expected failure

This draft intentionally fails against the current PR #807 implementation:

SchemaError: Expected string, got 42
  at ["params"][0]

PreparedStatement.bind accepts native D1 values, but the pinned Distilled D1 request schema models both single and batch params as string[]. The failure occurs during request encoding, before the query reaches Cloudflare.

Verification

timeout 240s bun vitest run test/Cloudflare/D1/QueryDatabaseLocal.test.ts

The existing string-parameter test passes. The dedicated numeric-parameter test creates its temporary D1 database, reaches the Action, fails on .bind(42) as expected, and deletes the database during cleanup.

This PR is stacked on #807 as an executable reproduction; it should become green when the Distilled D1 parameter schema and Local normalization support native D1 values.

@sam-goodwin sam-goodwin deleted the branch alchemy-run:claude/alchemy-actions-local-bindings-825ac1 July 16, 2026 04:53
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.

2 participants