Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce D1PreparedStatement.bind_refs which does not take ownership #493

Merged
merged 8 commits into from
Mar 26, 2024

Conversation

kflansburg
Copy link
Contributor

bind does not actually need owned values

@kflansburg kflansburg requested a review from zebp March 25, 2024 00:09
worker/src/d1/mod.rs Outdated Show resolved Hide resolved
worker/src/d1/mod.rs Outdated Show resolved Hide resolved
@kflansburg kflansburg force-pushed the kflansburg/bind-refs branch from 9cf72a2 to ac41bca Compare March 25, 2024 16:10
@kflansburg kflansburg force-pushed the kflansburg/bind-refs branch from e691207 to e9934f2 Compare March 25, 2024 19:26
@kflansburg kflansburg force-pushed the kflansburg/bind-refs branch from e9934f2 to d36e6c2 Compare March 25, 2024 19:42
@kflansburg kflansburg merged commit a55205f into main Mar 26, 2024
3 checks passed
@kflansburg kflansburg deleted the kflansburg/bind-refs branch March 26, 2024 16:48
jdon pushed a commit to jdon/workers-rs that referenced this pull request Mar 27, 2024
…cloudflare#493)

* Introduce D1PreparedStatement.bind_refs which does not take ownership of arguments

* Do not consume prepared statement when binding and batch binding

* Fix D1 tests in CI

* Introduce D1 type enum, support IntoIterator bind arguments

* D1Type Create JsValue on construction

* Another pass on the API ergonomics

* nits / docs

* Tweak batch_bind
jakubadamw referenced this pull request in grafbase/grafbase Mar 28, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence | Type |
Update |
|---|---|---|---|---|---|---|---|
|
[@types/bun](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/bun)
([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/bun))
| [`1.0.10` ->
`1.0.11`](https://renovatebot.com/diffs/npm/@types%2fbun/1.0.10/1.0.11)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@types%2fbun/1.0.11?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@types%2fbun/1.0.11?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@types%2fbun/1.0.10/1.0.11?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@types%2fbun/1.0.10/1.0.11?slim=true)](https://docs.renovatebot.com/merge-confidence/)
| devDependencies | patch |
|
[@types/react](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react)
([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react))
| [`18.2.70` ->
`18.2.73`](https://renovatebot.com/diffs/npm/@types%2freact/18.2.70/18.2.73)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@types%2freact/18.2.73?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@types%2freact/18.2.73?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@types%2freact/18.2.70/18.2.73?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@types%2freact/18.2.70/18.2.73?slim=true)](https://docs.renovatebot.com/merge-confidence/)
| devDependencies | patch |
|
[@typescript-eslint/eslint-plugin](https://togithub.com/typescript-eslint/typescript-eslint)
([source](https://togithub.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin))
| [`7.3.1` ->
`7.4.0`](https://renovatebot.com/diffs/npm/@typescript-eslint%2feslint-plugin/7.3.1/7.4.0)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@typescript-eslint%2feslint-plugin/7.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@typescript-eslint%2feslint-plugin/7.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@typescript-eslint%2feslint-plugin/7.3.1/7.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@typescript-eslint%2feslint-plugin/7.3.1/7.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
| devDependencies | minor |
|
[@typescript-eslint/parser](https://togithub.com/typescript-eslint/typescript-eslint)
([source](https://togithub.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser))
| [`7.3.1` ->
`7.4.0`](https://renovatebot.com/diffs/npm/@typescript-eslint%2fparser/7.3.1/7.4.0)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@typescript-eslint%2fparser/7.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@typescript-eslint%2fparser/7.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@typescript-eslint%2fparser/7.3.1/7.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@typescript-eslint%2fparser/7.3.1/7.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
| devDependencies | minor |
| [chrono](https://togithub.com/chronotope/chrono) | `0.4.35` ->
`0.4.37` |
[![age](https://developer.mend.io/api/mc/badges/age/crate/chrono/0.4.37?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/crate/chrono/0.4.37?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/crate/chrono/0.4.37/0.4.37?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/crate/chrono/0.4.37/0.4.37?slim=true)](https://docs.renovatebot.com/merge-confidence/)
| dependencies | patch |
| [insta](https://insta.rs/)
([source](https://togithub.com/mitsuhiko/insta)) | `1.36.1` -> `1.37.0`
|
[![age](https://developer.mend.io/api/mc/badges/age/crate/insta/1.37.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/crate/insta/1.37.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/crate/insta/1.37.0/1.37.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/crate/insta/1.37.0/1.37.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
| dev-dependencies | patch |
| [insta](https://insta.rs/)
([source](https://togithub.com/mitsuhiko/insta)) | `1.36` -> `1.37` |
[![age](https://developer.mend.io/api/mc/badges/age/crate/insta/1.37.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/crate/insta/1.37.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/crate/insta/1.37.0/1.37.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/crate/insta/1.37.0/1.37.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
| dependencies | patch |
| [lambda_http](https://togithub.com/awslabs/aws-lambda-rust-runtime) |
`0.9.3` -> `0.11.0` |
[![age](https://developer.mend.io/api/mc/badges/age/crate/lambda_http/0.11.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/crate/lambda_http/0.11.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/crate/lambda_http/0.9.3/0.11.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/crate/lambda_http/0.9.3/0.11.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
| dependencies | minor |
| [swc_ecma_parser](https://togithub.com/swc-project/swc) | `0.143.10`
-> `0.143.11` |
[![age](https://developer.mend.io/api/mc/badges/age/crate/swc_ecma_parser/0.143.11?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/crate/swc_ecma_parser/0.143.11?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/crate/swc_ecma_parser/0.143.11/0.143.11?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/crate/swc_ecma_parser/0.143.11/0.143.11?slim=true)](https://docs.renovatebot.com/merge-confidence/)
| dependencies | patch |
| [tokio-rustls](https://togithub.com/rustls/tokio-rustls) | `0.25.0` ->
`0.26.0` |
[![age](https://developer.mend.io/api/mc/badges/age/crate/tokio-rustls/0.26.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/crate/tokio-rustls/0.26.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/crate/tokio-rustls/0.25.0/0.26.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/crate/tokio-rustls/0.25.0/0.26.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
| workspace.dependencies | minor |
| [worker](https://togithub.com/cloudflare/workers-rs) | `0.0.21` ->
`0.0.23` |
[![age](https://developer.mend.io/api/mc/badges/age/crate/worker/0.0.23?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/crate/worker/0.0.23?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/crate/worker/0.0.21/0.0.23?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/crate/worker/0.0.21/0.0.23?slim=true)](https://docs.renovatebot.com/merge-confidence/)
| dependencies | patch |
| [worker](https://togithub.com/cloudflare/workers-rs) | `0.0.21` ->
`0.0.23` |
[![age](https://developer.mend.io/api/mc/badges/age/crate/worker/0.0.23?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/crate/worker/0.0.23?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/crate/worker/0.0.21/0.0.23?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/crate/worker/0.0.21/0.0.23?slim=true)](https://docs.renovatebot.com/merge-confidence/)
| workspace.dependencies | patch |

---

### Release Notes

<details>
<summary>typescript-eslint/typescript-eslint
(@&#8203;typescript-eslint/eslint-plugin)</summary>

###
[`v7.4.0`](https://togithub.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#740-2024-03-25)

[Compare
Source](https://togithub.com/typescript-eslint/typescript-eslint/compare/v7.3.1...v7.4.0)

##### 🚀 Features

- **eslint-plugin:** \[consistent-type-imports] ignore files with
decorators, experimentalDecorators, and emitDecoratorMetadata

- **eslint-plugin:** \[no-unnecessary-type-arguments] handle tagged
templates

- **eslint-plugin:** deprecate no-throw-literal and add a renamed
only-throw-error

##### 🩹 Fixes

- **eslint-plugin:** \[prefer-optional-chain] address multipart nullish
checks false positive

- **eslint-plugin:** \[prefer-optional-chain] properly disambiguate
between `boolean` and `false`

- **eslint-plugin:** \[no-unnecessary-type-assertion] avoid remove const
casting on template literals with expressions inside

##### ❤️  Thank You

-   Abraham Guo
-   Brad Zacher
-   Josh Goldberg ✨
-   Kim Sang Du
-   Kirk Waiblinger
-   Marco Pasqualetti
-   YeonJuan

You can read about our [versioning
strategy](https://main--typescript-eslint.netlify.app/users/versioning)
and
[releases](https://main--typescript-eslint.netlify.app/users/releases)
on our website.

</details>

<details>
<summary>typescript-eslint/typescript-eslint
(@&#8203;typescript-eslint/parser)</summary>

###
[`v7.4.0`](https://togithub.com/typescript-eslint/typescript-eslint/compare/v7.3.1...5d2469142262672e381db3b4a4e2bffa80984810)

[Compare
Source](https://togithub.com/typescript-eslint/typescript-eslint/compare/v7.3.1...v7.4.0)

</details>

<details>
<summary>cloudflare/workers-rs (worker)</summary>

###
[`v0.0.23`](https://togithub.com/cloudflare/workers-rs/releases/tag/v0.0.23)

[Compare
Source](https://togithub.com/cloudflare/workers-rs/compare/v0.0.22...v0.0.23)

#### What's Changed

- fix: add schedule re-export by
[@&#8203;avsaase](https://togithub.com/avsaase) in
[https://github.com/cloudflare/workers-rs/pull/501](https://togithub.com/cloudflare/workers-rs/pull/501)
- Fix absence of worker::secret documentation by
[@&#8203;Kakapio](https://togithub.com/Kakapio) in
[https://github.com/cloudflare/workers-rs/pull/500](https://togithub.com/cloudflare/workers-rs/pull/500)
- README: Fix beginning of code snippet by
[@&#8203;kevinji](https://togithub.com/kevinji) in
[https://github.com/cloudflare/workers-rs/pull/499](https://togithub.com/cloudflare/workers-rs/pull/499)
- Implement Send, Sync and Clone for Fetcher by
[@&#8203;avsaase](https://togithub.com/avsaase) in
[https://github.com/cloudflare/workers-rs/pull/503](https://togithub.com/cloudflare/workers-rs/pull/503)

#### New Contributors

- [@&#8203;Kakapio](https://togithub.com/Kakapio) made their first
contribution in
[https://github.com/cloudflare/workers-rs/pull/500](https://togithub.com/cloudflare/workers-rs/pull/500)
- [@&#8203;kevinji](https://togithub.com/kevinji) made their first
contribution in
[https://github.com/cloudflare/workers-rs/pull/499](https://togithub.com/cloudflare/workers-rs/pull/499)

**Full Changelog**:
cloudflare/workers-rs@v0.0.22...v0.0.23

###
[`v0.0.22`](https://togithub.com/cloudflare/workers-rs/releases/tag/v0.0.22)

[Compare
Source](https://togithub.com/cloudflare/workers-rs/compare/v0.0.21...v0.0.22)

This release continues our conversion to the `http` crate. In a number
of key ways:

- [Convert test suite to use
`axum`](https://togithub.com/cloudflare/workers-rs/pull/481) when `http`
feature is enabled. This was a great dogfooding exercise and helped to
identify ergonomics issues. Based on this we developed the utilities
([see
documentation](https://docs.rs/worker/0.0.22/worker/#send-helpers)):
- Introduce `worker::send` to mark arbitrary `async` functions as `Send`
(useful for `axum` handler methods).
- Introduce `SendFuture` wrapper for marking a specific `Future` as
`Send`.
- Introduce `SendWrapper` for marking a particular object as `Send`.
This is useful for `axum` router state.
- Implement [Send,
Sync](https://togithub.com/cloudflare/workers-rs/pull/483), and
[Clone](https://togithub.com/cloudflare/workers-rs/pull/484) for Queue,
making it easier to use with `axum`. Thanks
[@&#8203;avsaase](https://togithub.com/avsaase)!

We will continue to make ergonomic improvements to simplify usage of
`axum` and other frameworks which generally expect objects to be `Send`,
`Sync`, and `Clone`.

#### Other Changes

- implement get_tags for hibernatable websockets by
[@&#8203;eric-seppanen](https://togithub.com/eric-seppanen) in
[https://github.com/cloudflare/workers-rs/pull/484](https://togithub.com/cloudflare/workers-rs/pull/484)
- Add tests for Durable + Websocket + Hibernation API by
[@&#8203;j-white](https://togithub.com/j-white) in
[https://github.com/cloudflare/workers-rs/pull/495](https://togithub.com/cloudflare/workers-rs/pull/495)
- Introduce `D1PreparedStatement.bind_refs` and `batch_bind` which does
not take ownership of arguments, and enables more ergonomic and
performant use of the D1 API. It also introduces `D1Type` which provides
better type safety for these arguments than the previous API which
allowed arbitrary `JsValue`.
[@&#8203;kflansburg](https://togithub.com/kflansburg) in
[https://github.com/cloudflare/workers-rs/pull/493](https://togithub.com/cloudflare/workers-rs/pull/493)
- Expose DurableObject Storage's transaction function by
[@&#8203;TannerRogalsky](https://togithub.com/TannerRogalsky) in
[https://github.com/cloudflare/workers-rs/pull/487](https://togithub.com/cloudflare/workers-rs/pull/487)

#### New Contributors

- [@&#8203;avsaase](https://togithub.com/avsaase) made their first
contribution in
[https://github.com/cloudflare/workers-rs/pull/483](https://togithub.com/cloudflare/workers-rs/pull/483)
- [@&#8203;TannerRogalsky](https://togithub.com/TannerRogalsky) made
their first contribution in
[https://github.com/cloudflare/workers-rs/pull/487](https://togithub.com/cloudflare/workers-rs/pull/487)

**Full Changelog**:
cloudflare/workers-rs@v0.0.21...v0.0.22

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am on Monday" (UTC),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/grafbase/grafbase).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
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