Series: API with NestJS

NestJS

API with NestJS #171. Recursive relationships with Drizzle ORM and PostgreSQL

This entry is part 171 of 174 in the API with NestJS

Managing relationships between the tables in our database is one of the fundamental aspects of using SQL. When a particular table points back to itself, it creates a recursive relationship. In this article, we learn what the recursive relationships are and how to work with them using the Drizzle ORM and PostgreSQL. We sometimes refer to […]

NestJS

API with NestJS #172. Database normalization with Drizzle ORM and PostgreSQL

This entry is part 172 of 174 in the API with NestJS

Database normalization is a key part of database design, but it’s often explained in complicated terms. In this article, we’ll break down the normalization rules and provide down-to-earth examples using Drizzle ORM and PostgreSQL. Database normalization aims to avoid unnecessarily duplicating our data and make it easier to manage. It does that through specific rules […]

NestJS

API with NestJS #173. Storing money with Drizzle ORM and PostgreSQL

This entry is part 173 of 174 in the API with NestJS

We can’t cut corners on certain aspects of web development, and storing monetary values is one of them. In this article, we explore various data types in PostgreSQL we could use and discuss which ones to avoid. The drawbacks of floating point numbers When thinking about money, we often have to deal with fractions – […]

NestJS SQL

API with NestJS #174. Multiple PostgreSQL schemas with Drizzle ORM

This entry is part 174 of 174 in the API with NestJS

PostgreSQL uses schemas as namespaces within the database to hold tables and other structures, such as indexes. In this article, we explain how to use them with the Drizzle ORM and how they can be beneficial. The public schema Out of the box, PostgreSQL creates a schema called for each new database. database-schema.ts

[…]