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

feat(cloudflare): add local mocking for D1 bindings #8655

Merged
merged 2 commits into from
Oct 2, 2023

Conversation

alexanderniebuhr
Copy link
Member

@alexanderniebuhr alexanderniebuhr commented Sep 24, 2023

Changes

  • new: local mocking for D1 bindings

Testing

  • existing tests
  • added tests for D1

Docs

/cc @withastro/maintainers-docs for feedback!

@changeset-bot
Copy link

changeset-bot bot commented Sep 24, 2023

🦋 Changeset detected

Latest commit: 0942cd1

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: integration Related to any renderer integration (scope) label Sep 24, 2023
@alexanderniebuhr alexanderniebuhr changed the title feat(cloudflare): add D1 database binding feat(cloudflare): add local mocking for D1 bindings Sep 24, 2023
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/chore_cloudflare_refactor_structure_optimize_patterns branch from d410df7 to a49d331 Compare September 24, 2023 07:12
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/feat_cloudflare_add_D1_database_binding branch from 50714ad to 8dc4a55 Compare September 24, 2023 07:16
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/chore_cloudflare_refactor_structure_optimize_patterns branch from a49d331 to 24d691a Compare September 24, 2023 07:21
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/feat_cloudflare_add_D1_database_binding branch 4 times, most recently from 059a10d to 61411de Compare September 24, 2023 08:03
@alexanderniebuhr alexanderniebuhr marked this pull request as ready for review September 24, 2023 08:32
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/feat_cloudflare_add_D1_database_binding branch 2 times, most recently from 5f90aa7 to cea45d1 Compare September 24, 2023 10:26
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/chore_cloudflare_refactor_structure_optimize_patterns branch from 24d691a to ecf0487 Compare September 25, 2023 08:38
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/feat_cloudflare_add_D1_database_binding branch from cea45d1 to fcd7054 Compare September 25, 2023 08:38
Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see the documentation updated. Is it intended?

packages/integrations/cloudflare/src/index.ts Outdated Show resolved Hide resolved
packages/integrations/cloudflare/src/index.ts Outdated Show resolved Hide resolved
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/feat_cloudflare_add_D1_database_binding branch 2 times, most recently from 28a2d4b to 3643cfd Compare September 25, 2023 10:10
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/chore_cloudflare_refactor_structure_optimize_patterns branch from ecf0487 to 8038cb9 Compare September 25, 2023 12:32
@alexanderniebuhr alexanderniebuhr requested a review from a team as a code owner September 25, 2023 12:32
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/feat_cloudflare_add_D1_database_binding branch 5 times, most recently from e459eee to ebc0fe8 Compare September 25, 2023 13:45
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/chore_cloudflare_refactor_structure_optimize_patterns branch from 8038cb9 to 3b43d38 Compare September 25, 2023 13:52
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/chore_cloudflare_refactor_structure_optimize_patterns branch from 274dc33 to 0a551c1 Compare September 27, 2023 13:43
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/feat_cloudflare_add_D1_database_binding branch from 096349b to a42d7a3 Compare September 27, 2023 13:43
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/chore_cloudflare_refactor_structure_optimize_patterns branch from 0a551c1 to b6bc935 Compare September 27, 2023 14:05
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/feat_cloudflare_add_D1_database_binding branch from a42d7a3 to f8d0355 Compare September 27, 2023 14:05
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/chore_cloudflare_refactor_structure_optimize_patterns branch from b6bc935 to 68a95a3 Compare September 27, 2023 14:20
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/feat_cloudflare_add_D1_database_binding branch from f8d0355 to f49c945 Compare September 27, 2023 14:20
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/chore_cloudflare_refactor_structure_optimize_patterns branch from 68a95a3 to 8453a25 Compare September 28, 2023 12:58
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/feat_cloudflare_add_D1_database_binding branch from f49c945 to 8470627 Compare September 28, 2023 13:16
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/chore_cloudflare_refactor_structure_optimize_patterns branch from 8453a25 to 798d018 Compare September 28, 2023 15:21
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/feat_cloudflare_add_D1_database_binding branch from 8470627 to 112e188 Compare September 28, 2023 15:21
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/chore_cloudflare_refactor_structure_optimize_patterns branch from 798d018 to 83499e6 Compare September 28, 2023 15:47
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/feat_cloudflare_add_D1_database_binding branch from 112e188 to c223bcd Compare September 28, 2023 15:47
Base automatically changed from nbhr/chore_cloudflare_refactor_structure_optimize_patterns to main September 28, 2023 16:04
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/feat_cloudflare_add_D1_database_binding branch 4 times, most recently from 5c21695 to 4d5295c Compare September 28, 2023 19:12
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/feat_cloudflare_add_D1_database_binding branch 2 times, most recently from cd8fee0 to b9477fe Compare September 30, 2023 05:42
@@ -212,7 +212,11 @@ export default defineConfig({

## Cloudflare runtime

Gives you access to [environment variables](https://developers.cloudflare.com/pages/platform/functions/bindings/#environment-variables).
Gives you access to [environment variables](https://developers.cloudflare.com/pages/platform/functions/bindings/#environment-variables), [Cloudflare bindings](https://developers.cloudflare.com/pages/platform/functions/bindings).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Gives you access to [environment variables](https://developers.cloudflare.com/pages/platform/functions/bindings/#environment-variables), [Cloudflare bindings](https://developers.cloudflare.com/pages/platform/functions/bindings).
Gives you access to [environment variables](https://developers.cloudflare.com/pages/platform/functions/bindings/#environment-variables), and [Cloudflare bindings](https://developers.cloudflare.com/pages/platform/functions/bindings).

Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Just an idea for the changeset verb tense, in case you felt you wanted guidance, and one little missing "and" below! 🥳

.changeset/hungry-mails-boil.md Outdated Show resolved Hide resolved
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/feat_cloudflare_add_D1_database_binding branch from b9477fe to 1eb7836 Compare October 2, 2023 13:43
This addition allows using D1 databases within the Astro dev server.

---------

Co-authored-by: Sarah Rainsberger <[email protected]>
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/feat_cloudflare_add_D1_database_binding branch from 1eb7836 to 0732c3a Compare October 2, 2023 13:47
* feat(cloudflare): add support for r2 bindings

This update provides users the ability to leverage Cloudflare's R2 storage within the system.

---------

Co-authored-by: Sarah Rainsberger <[email protected]>

* feat(cloudflare): add local mocking for KV bindings (#8657)

* feat(cloudflare): Add KV Bindings

---------

Co-authored-by: Sarah Rainsberger <[email protected]>

* feat(cloudflare): add local mocking for Caches bindings (#8664)

* feature(cloudflare): add Caches bindings

---------

Co-authored-by: Sarah Rainsberger <[email protected]>

* feat(cloudflare): add local mocking for DO bindings (#8690)

---------

Co-authored-by: Sarah Rainsberger <[email protected]>

---------

Co-authored-by: Sarah Rainsberger <[email protected]>

---------

Co-authored-by: Sarah Rainsberger <[email protected]>

---------

Co-authored-by: Sarah Rainsberger <[email protected]>
@alexanderniebuhr alexanderniebuhr merged commit 3dd65bf into main Oct 2, 2023
3 of 4 checks passed
@alexanderniebuhr alexanderniebuhr deleted the nbhr/feat_cloudflare_add_D1_database_binding branch October 2, 2023 14:04
@astrobot-houston astrobot-houston mentioned this pull request Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants