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

fix: pass schema to drizzle client for better type generation #459

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

manuel3108
Copy link
Member

@manuel3108 manuel3108 commented Feb 27, 2025

closes #452

This PR basically changes src\lib\server\db\index.ts from

export const db = drizzle(client);

to

export const db = drizzle(client, {
    schema
});

For both mysql based options (mysql2 and planetscale) another property mode is added to the config object.

I' was unable to test the planetscale implementation though, as their pricing is off the charts. We should consider dropping it in the future.

Copy link

changeset-bot bot commented Feb 27, 2025

🦋 Changeset detected

Latest commit: cdb9c7a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
sv Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

pkg-pr-new bot commented Feb 27, 2025

Open in Stackblitz

npm i https://pkg.pr.new/sveltejs/cli/sv@459
npm i https://pkg.pr.new/sveltejs/cli/svelte-migrate@459

commit: cdb9c7a

@manuel3108 manuel3108 marked this pull request as draft February 27, 2025 16:36
@manuel3108 manuel3108 marked this pull request as ready for review March 1, 2025 10:08
@manuel3108
Copy link
Member Author

Updated PR description to reflect our discussion yesterday.

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 this pull request may close these issues.

Drizzle option generates code that did not work for me.
1 participant