Skip to content

MySQL driver does not have default import #25

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

Closed
woowenjun99 opened this issue Apr 25, 2024 · 3 comments
Closed

MySQL driver does not have default import #25

woowenjun99 opened this issue Apr 25, 2024 · 3 comments

Comments

@woowenjun99
Copy link
Contributor

When I use the MySQL driver, sqlc generates

import mysql, { RowDataPacket } from "mysql2/promise";

However, there is no default import for mysql. Changing to the following works:

import * as mysql from "mysql2/promise";
@woowenjun99 woowenjun99 changed the title MySQL driver wrong import MySQL driver does not have default import Apr 25, 2024
@kyleconroy
Copy link
Contributor

So I have an end-to-end test to ensure that the generated code works with MySQL. You can see the import I'm using there works just fine. Can you help me understand why my example works and yours doesn't?

@yshrsmz
Copy link
Contributor

yshrsmz commented May 27, 2024

@woowenjun99 I can also confirm that it's working fine in its current form.
How do you configure your tsconfig.json?

@woowenjun99
Copy link
Contributor Author

woowenjun99 commented May 30, 2024

Hi @kyleconroy @yshrsmz try using "postgresql" as the engine for MySQL prior to my PR and it should produce the result.

The issue should be fixed by the PR referenced to this GitHub issue. Will be closing this issue

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

No branches or pull requests

3 participants