Skip to content

Include the Outerbase SDK for external database connections#39

Merged
Brayden merged 6 commits intomainfrom
bwilmoth/sdk
Nov 25, 2024
Merged

Include the Outerbase SDK for external database connections#39
Brayden merged 6 commits intomainfrom
bwilmoth/sdk

Conversation

@Brayden
Copy link
Member

@Brayden Brayden commented Nov 23, 2024

Purpose

Connecting to external data sources through your Starbase instance can help enhance your external database, whether it's by caching query data, serving as a data transformation layer (either before reaching the database, or before returning back to the client), acting as an extension to your database for development, or more.

This pull request makes it possible for the Worker to forward requests directly to your database via native drivers utilizing the Outerbase SDK. You can still opt to pass in an Outerbase API key instead and the request will be routed to Outerbase, but this will perhaps remove an extra hop/step in the flow by connecting to your database directly.

This also fixes issue #40 where the REST endpoint does not work for DELETE calls.

Tasks

  • Support Postgres
  • Support MySQL
  • Support Mongo
  • Support D1
  • Support Turso
  • Support Starbase

Verify

  • Verify the afterQuery hook gets called on these new requests
  • Verify each connection type listed above works as expected
  • Verify usage of the EXTERNAL_DB_DEFAULT_SCHEMA declaration in wrangler.toml

Before

After

@Brayden Brayden self-assigned this Nov 23, 2024
@Brayden Brayden added the enhancement New feature or request label Nov 23, 2024
@Brayden Brayden marked this pull request as ready for review November 23, 2024 20:58
@Brayden Brayden merged commit 0a00ac9 into main Nov 25, 2024
@Brayden Brayden deleted the bwilmoth/sdk branch November 25, 2024 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants