Skip to content

Support both mysql2 and mysql2/promise in MysqlDialect. #1465

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

Open
igalklebanov opened this issue May 18, 2025 · 1 comment
Open

Support both mysql2 and mysql2/promise in MysqlDialect. #1465

igalklebanov opened this issue May 18, 2025 · 1 comment
Labels
built-in dialect Related to a built-in dialect enhancement New feature or request internal mysql Related to MySQL

Comments

@igalklebanov
Copy link
Member

Hey 👋

We support mysql2, not mysql2/promise.

This can be a real pain and waste of time for people setting up kysely in their projects.

You setup mysql/promise pass it's pool stuff to the dialect, it doesn't yell at you. You spin up your service locally, and queries just hang, no errors, no indication what's wrong. A needle in a haystack.

Can we detect, on driver initialization, whether it's the promise pool or the callback pool, and apply the right strategy from that point on?

@igalklebanov igalklebanov added enhancement New feature or request mysql Related to MySQL built-in dialect Related to a built-in dialect internal labels May 18, 2025
@koskimas
Copy link
Member

koskimas commented May 19, 2025

Makes sense. We can just promisify the callback version very early on in the dialect so that most of the dialect code can use just one API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
built-in dialect Related to a built-in dialect enhancement New feature or request internal mysql Related to MySQL
Projects
None yet
Development

No branches or pull requests

2 participants