-
Notifications
You must be signed in to change notification settings - Fork 671
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
feat(drizzle): Migrate to Drizzle ORM #404
base: main
Are you sure you want to change the base?
Conversation
@realmikesolo is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great!
app/[domain]/[slug]/page.tsx
Outdated
@@ -113,7 +109,7 @@ export default async function SitePostPage({ | |||
href={ | |||
data.site?.user?.username | |||
? `https://twitter.com/${data.site.user.username}` | |||
: `https://github.com/${data.site?.user?.gh_username}` | |||
: `https://github.com/${data.site?.user?.ghUsername}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this require a data migration?
lib/actions.ts
Outdated
}) | ||
.returning(); | ||
|
||
// unnecessary await |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the await?
lib/actions.ts
Outdated
.where(eq(sites.id, site.id)) | ||
.returning(); | ||
|
||
await revalidateTag( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
await revalidateTag( | |
revalidateTag( |
lib/actions.ts
Outdated
`${site.subdomain}.${process.env.NEXT_PUBLIC_ROOT_DOMAIN}-metadata`, | ||
); | ||
response.customDomain && | ||
(await revalidateTag(`${site.customDomain}-metadata`)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(await revalidateTag(`${site.customDomain}-metadata`)); | |
revalidateTag(`${site.customDomain}-metadata`); |
lib/actions.ts
Outdated
}) | ||
.returning(); | ||
|
||
await revalidateTag( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
await revalidateTag( | |
revalidateTag( |
It's an interesting choice to move away from a project that enterprises and governments support to one that's unknown and may require security reviews. What benefits make this worth it? |
@m-torin if you would like to use Prisma, that's great. Please do! I don't have anything against Prisma. In fact, we just worked with them on this https://db-latency.vercel.app/. |
I made some edits based on the review, updated the Currently, there are two bugs related to Please let me know if anything needs updating. |
app/[domain]/[slug]/page.tsx
Outdated
import { getPostData, getSiteData } from "@/lib/fetchers"; | ||
import BlogCard from "@/components/blog-card"; | ||
import BlurImage from "@/components/blur-image"; | ||
import MDX from "@/components/mdx"; | ||
import { placeholderBlurhash, toDateString } from "@/lib/utils"; | ||
import db from "@/lib/db/db"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inline
components/posts.tsx
Outdated
|
||
return posts.length > 0 ? ( | ||
const query = db |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make in query syntax
components/sites.tsx
Outdated
}); | ||
const query = db | ||
.select({ | ||
...getTableColumns(sites), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redundant
Bugs with Drizzle-kit were fixed |
This PR was made to migrate from Prisma to Drizzle ORM. It involves rewriting the database interactions using
Drizzle ORM
.