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: export database instances #132

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sandros94
Copy link

@sandros94 sandros94 commented Dec 11, 2024

Resolves #131

A non-breaking change that adds getInstance (following the naming convention from unstorage) to access a fully typed database client used internally.

Notes

  • wasn't able to test mysql and planetscale

@sandros94
Copy link
Author

while debugging why the mysql test is failing it was pointed out on discord that it is missing from the connector's meta

db0/src/index.ts

Lines 17 to 29 in 41ff740

export const connectors = {
sqlite: "db0/connectors/better-sqlite3",
postgresql: "db0/connectors/postgresql",
pglite: "db0/connectors/pglite",
"cloudflare-d1": "db0/connectors/cloudflare-d1",
libsql: "db0/connectors/libsql/node",
"libsql-node": "db0/connectors/libsql/node",
"libsql-http": "db0/connectors/libsql/http",
"libsql-web": "db0/connectors/libsql/web",
bun: "db0/connectors/bun-sqlite",
"bun-sqlite": "db0/connectors/bun-sqlite",
planetscale: "db0/connectors/planetscale",
} as const;

This at least explains the ts error

Copy link

codecov bot commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 84.21053% with 3 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@db54a4c). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/connectors/bun-sqlite.ts 0.00% 2 Missing ⚠️
src/connectors/cloudflare-d1.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #132   +/-   ##
=======================================
  Coverage        ?   46.24%           
=======================================
  Files           ?       19           
  Lines           ?      679           
  Branches        ?       66           
=======================================
  Hits            ?      314           
  Misses          ?      360           
  Partials        ?        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ahocevar
Copy link

Is there anything I can do to help finish this? Do we need to make Codecov happy? Are tests for mysql and planetscale needed?

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.

allow returning the client
2 participants