cloudflare / cloudflare/workerd

Better type-safety for `bind` method of `D1PreparedStatement`

Open
#5,085 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
8.7k
Forks
739
Avg merge
2d 20h
Merged PRs (30d)
174

Description

### Describe the solution

The `bind` method on `D1PreparedStatement` takes `unknown[]` as an argument.
```
declare abstract class D1PreparedStatement {
bind(...values: unknown[]): D1PreparedStatement;
}
```

Ask for more restrictive type so Typescript can provide better type-safety and guardrails for llms.

Reference: https://developers.cloudflare.com/d1/worker-api/#type-conversion

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.