Drizzle TeamDT
Drizzle Team2y ago
2 replies
Charledeon

Constrain Numeric or Integer inputs

I've reached the point where I'm creating a Database Schema using Drizzle ORM with a Postgres SQL Database on a NodeJS backend.

I read the Drizzle Documentation, but I still don't get the full details of really setting up connection to my Database.

Then I watched all the possible Drizzle Videos on Youtube.

Unfortunately, only the video from Kyle ( https://youtu.be/7-NZ0MlPpJA ) -- got me started on Drizzle because it is the only video that was intended to teach the beginner, and did not assume that we already know something somewhere.

THE PROBLEM
1.) Phone or Mobile numbers are 11 Digits.

How do I constrain the Phone Field in my Postgres Schema to receive only 11 Digits either of the Numeric or Integer Data Type in Postgres?

2.) Which Data Type do I use to store Images, for my users?
3.) If I am asking for Social links-- where my users are expected to enter more than one Social link, is it Json Data Type or Array data Type, or which Data type should I use for this?

Regards.
YouTubeWeb Dev Simplified
Drizzle is a relatively new database ORM that aims to solve many of the problems with existing ORMs by being more flexible and performant. They have definitely accomplished their goals, but learning Drizzle can be quite overwhelming. In this crash course I will teach you everything you need to know about Drizzle to use it in your very own projec...
Learn Drizzle In 60 Minutes
Was this page helpful?