Skip to content

feat(adapters): Drizzle adapter#8258

Merged
balazsorban44 merged 206 commits intomainfrom
anthonyshew/main
Aug 8, 2023
Merged

feat(adapters): Drizzle adapter#8258
balazsorban44 merged 206 commits intomainfrom
anthonyshew/main

Conversation

@balazsorban44
Copy link
Copy Markdown
Member

@balazsorban44 balazsorban44 commented Aug 8, 2023

Finishing up @anthonyshew's PR #7165

Introducing a drizzle-orm adapter!

With drizzle's increasing popularity, it's no surprise that there's a discussion for an adapter. This PR adds it.

Notes

Closes #7165

@vercel
Copy link
Copy Markdown

vercel bot commented Aug 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
auth-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 8, 2023 5:11pm
next-auth-docs 🔄 Building (Inspect) Visit Preview 💬 Add feedback Aug 8, 2023 5:11pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
auth-docs-nextra ⬜️ Ignored (Inspect) Visit Preview Aug 8, 2023 5:11pm

@github-actions github-actions bot added the adapters Changes related to the core code concerning database adapters label Aug 8, 2023

const poolConnection = createPool({
host: "localhost",
user: "root",

Check failure

Code scanning / CodeQL

Hard-coded credentials

The hard-coded value "root" is used as [user name](1).
@socket-security
Copy link
Copy Markdown

New dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
drizzle-kit 0.19.12 eval, filesystem, environment +1 3.32 MB dankochetov

@balazsorban44 balazsorban44 marked this pull request as ready for review August 8, 2023 11:41
Copy link
Copy Markdown
Member

@ndom91 ndom91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't tested it locally, but in general lgtm.

Some general feedback though, do we really need separate method implementations for each underlying db type (MySQL, postgres, etc.)?

Also these inline docs for TS hinting are getting a bit long 😅

@balazsorban44 balazsorban44 merged this pull request into main Aug 8, 2023
@balazsorban44 balazsorban44 deleted the anthonyshew/main branch August 8, 2023 17:28
balazsorban44 added a commit that referenced this pull request Aug 8, 2023
Co-authored-by: Anthony Shew <anthonyshew@gmail.com>
@stunaz
Copy link
Copy Markdown

stunaz commented Sep 18, 2023

@balazsorban44 why all functions from SQLiteDrizzleAdapter are not async/await like the pg/mysql ?
I a ran to a bug without that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adapters Changes related to the core code concerning database adapters

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove instanceof checks to allow for multiple drizzle-orm instances to be used