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.
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