sqlc-dev/sqlc-gen-typescript

MySQL driver does not have default import

woowenjun99 opened this issue · 3 comments

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";

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?

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

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