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

Add dialects to connectors #112

Closed
1 task done
zsilbi opened this issue Sep 4, 2024 · 1 comment
Closed
1 task done

Add dialects to connectors #112

zsilbi opened this issue Sep 4, 2024 · 1 comment

Comments

@zsilbi
Copy link

zsilbi commented Sep 4, 2024

Describe the feature

The Connector type should be extended with an additional dialect property.
It should be a string that represents the SQL dialect that the connector supports.
For example: sqlite, postgresql or mysql

The Database interface should be extended with an additional getDialect method.
It should return the dialect or the connector that the database is using.

This would make integrating db0 with other libraries more straight forward.

I was wondering if these types should also be generic, so that other adapters/drivers could narrow allowing only specific dialects of db0 instances to be provided as dependency, like Database<"sqlite" | "postgresql">.

Related: unjs/unstorage#476

Additional information

  • Would you be willing to help implement this feature?
@pi0
Copy link
Member

pi0 commented Oct 9, 2024

Good idea! Added in #59

@pi0 pi0 closed this as completed Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants