Next 13, Next-Auth with Neon Postgres and Drizzle vs Prisma 5

I am trying to set up Next-Auth with Neon Postgres and Drizzle, but failing miserably.

I set up a repo with several branches, including configurations for:

1) Next 13, Next-Auth, Neon Postgres, Prisma 5
2) Next 13, Next-Auth, PlanetScale MySQL, Prisma 5
3) Next 13, Next-Auth, Neon Postgres, Drizzle

The first two work perfectly fine, I am able to authenticate and store users in a database, regardless of whether they are signing up with password, magic links, or OAuth providers.

However, I am facing weird issues with the Drizzle branch, particularly with getUserByEmailAction and other similar .select() -based queries, which for some weird reason sometimes return undefined.

The logic for all three branches is exactly the same and the code is nearly identical. If anyone would like to have a look and see if they are able to fix it, the code is available here:
https://github.com/pjborowiecki/SAASY-LAND-Next-13-Starters-With-Authentication-And-Database-Implemented

The branch I am referring to is called next-auth-drizzle-neon-postgres

Looking forward to some of you trying and pointing out the issue!
GitHub
Starter templates for Next.js 13 full-stack projects. Built with Tailwind CSS, ShadCn, authentication, and database. Several branches contain several different configurations, including serverless ...
Was this page helpful?