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

bug: [drizzle] rename connectionString to uri #1699

Closed
niebag opened this issue Dec 18, 2023 · 1 comment · Fixed by #1702
Closed

bug: [drizzle] rename connectionString to uri #1699

niebag opened this issue Dec 18, 2023 · 1 comment · Fixed by #1702

Comments

@niebag
Copy link

niebag commented Dec 18, 2023

Provide environment information

System:
OS: macOS 14.1
CPU: (10) arm64 Apple M1 Pro
Memory: 126.45 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.17.0 - ~/.nvm/versions/node/v18.17.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v18.17.0/bin/yarn
npm: 9.6.7 - ~/.nvm/versions/node/v18.17.0/bin/npm
pnpm: 8.9.2 - ~/.nvm/versions/node/v18.17.0/bin/pnpm
bun: 1.0.5 - ~/.bun/bin/bun

Describe the bug

connectionString seems outdated, uri seems to be the new name.

} | {
    driver: "mysql2";
    dbCredentials: {
        host: string;
        port?: number;
        user?: string;
        password?: string;
        database: string;
    } | {
        uri: string;
    };
Object literal may only specify known properties, and 'connectionString' does not exist in type '{ host: string; port?: number | undefined; user?: string | undefined; password?: string | undefined; database: string; } | { uri: string; }'

Reproduction repo

n/a

To reproduce

Install "drizzle-kit": "^0.20.7" and define a config as followed:

import { type Config } from "drizzle-kit";

import { env } from "~/env";

export default {
  schema: "./src/server/db/schema.ts",
  driver: "mysql2",
  dbCredentials: {
    connectionString: env.DATABASE_URL,
  },
  tablesFilter: ["create-t3-app_*"],
} satisfies Config;

A TypeScript error should occur:

Object literal may only specify known properties, and 'connectionString' does not exist in type '{ host: string; port?: number | undefined; user?: string | undefined; password?: string | undefined; database: string; } | { uri: string; }'

Additional information

No response

@c-ehrlich
Copy link
Member

Thanks for pointing this out! I've opened a PR to fix it :)

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

Successfully merging a pull request may close this issue.

2 participants