Skip to content

Database

This document describes how to access the database using Drizzle ORM.

import { db } from '$lib/db';
import { posts } from '@repo/db/schema';
import { eq, desc } from '@repo/db';
const items = await db.query.posts.findMany({
where: eq(posts.status, 'published'),
orderBy: desc(posts.createdAt)
});