Total Posts

0

Total Commits

0

(v1: 0, v2: 0)
Total Deployments

0

Latest commit:Unable to fetch commit info
6/23/2025
Latest deployment:
pending
6/23/2025
v2
Started 6/23/2025

Built by Remco Stoeten with a little ❤️

Snippets.remcostoeten
Snippets.remcostoeten
Snippets
Welcome to Snippets
Disable Sudo Password Prompts on macOS
Disable Sudo Password Prompts on macOS
Validate env variables
Drizzle ORM Schema Design
Setup Drizzle ORM with SQLite
Keybindings remap
Keyboard Tester Feature Prompt
Microphone Tester Feature Prompt
Webcam Tester
Practical Electron + Prisma Integration Guide
Complete Electron + Prisma Integration Guide
Git Branch Diverged
Git Set Upstream
Text Formatting Components
Suspense Wrapper Guide for SSR and Client UX
Databases/Drizzle orm

Drizzle ORM Schema Design

This will show you how to design your schema for Drizzle ORM in a modular, scalable and maintainable way. Often you see a single file with a bunch of tables and a migration file. This is not scalable and is hard to maintain.

I am a fan of strrong seperration of concerns and single principles which means we have a single file for each table, expectations to some degree.

The schema file

In our drizzle.config.ts we have a schema property which points to a file. This is the file that will be our main schema file. In this file we will NOT define the tables. We will only import them.

touch src/server/db/schema/index.ts

To be continued on partials****....****

Validate env variables

This will show you how to validate your enviorment variables. Will be showcasing two methods. One utilizing the `t3-oss/t3-env` package and the other one a custom implementation which can be very comprerhensive and give hints on what's missing for other devs who might want to run your project.

Setup Drizzle ORM with SQLite

Next Page

On this page

The schema file
Jun 23, 2025
2 min read
302 words