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

Config type for mysql #97

Closed
jeremiedubuis opened this issue Jun 21, 2023 · 2 comments
Closed

Config type for mysql #97

jeremiedubuis opened this issue Jun 21, 2023 · 2 comments

Comments

@jeremiedubuis
Copy link

Hi, first of all thanks for the great work on drizzle-orm and drizzle-kit.
I think I have spotted an error int he Config type exported for drizzle-kit.

Using a drizzle.config.ts file on mysql21 project and seeing the following type:

export type Config = {
    out?: string | undefined;
    breakpoints?: boolean | undefined;
    tablesFilter?: string | string[] | undefined;
    schema?: string | string[];
    verbose?: boolean | undefined;
    strict?: boolean | undefined;
} & {
    introspect?: {
        casing: "camel" | "preserve";
    };
} & ({
    driver: "turso";
    dbCredentials: {
        url: string;
        authToken?: string;
    };
} | {
    driver: "better-sqlite";
    dbCredentials: {
        url: string;
    };
} | {
    driver: "libsql";
    dbCredentials: {
        url: string;
    };
} | {
    driver: "pg";
    dbCredentials: {
        host: string;
        port?: number;
        user?: string;
        password?: string;
        database: string;
        ssl?: boolean;
    };
} | {
    driver: "pg";
    dbCredentials: {
        connectionString: string;
    };
} | {
    driver: "mysql2";
    dbCredentials: {
        host: string;
        port?: number;
        user?: string;
        password?: string;
        database: string;
        connectionString: string;
    };
} | {
    driver: "mysql2";
    dbCredentials: {
        connectionString: string;
    };
} | {});

For the mysql2 driver:

{
    driver: "mysql2";
    dbCredentials: {
        host: string;
        port?: number;
        user?: string;
        password?: string;
        database: string;
        connectionString: string;
    };
} | {
    driver: "mysql2";
    dbCredentials: {
        connectionString: string;
    };
}

It seems to me the connectionString should not be present for the first type.

@AndriiSherman
Copy link
Member

fixed in drizzle-kit@cjs, will be in latest today

@AndriiSherman
Copy link
Member

Fixed in drizzle-kit@0.19.2

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

2 participants