SQL

Defining generated columns with PostgreSQL and TypeORM

On this blog, we’ve covered a variety of different column types. So far, we’ve performed various operations on said columns such as and to modify the data directly. In this article, we cover generated columns that work differently. Generated columns in PostgreSQL We call the above columns generated because PostgreSQL automatically computes their data based […]

SQL

The basics of database normalization with TypeORM and PostgreSQL

Database normalization is a term often used when discussing database architecture design. Unfortunately, it is often presented with the use of complex definitions that make it difficult to grasp. In this article, we explain what normalization is and provide examples using TypeORM and PostgreSQL. Database normalization aims to improve the integrity and reduce the redundancy […]

JavaScript NestJS TypeScript

API with NestJS #56. Authorization with roles and claims

This entry is part 56 of 121 in the API with NestJS

So far, in this series, we’ve implemented authentication. By doing that, we can confirm that the users are who they claim to be. In this series, we explain how to implement authentication with JWT tokens or with server-side sessions. We also add two-factor authentication. While authorization might at first glance seem similar to authentication, it serves […]

JavaScript NestJS SQL TypeScript

API with NestJS #53. Implementing soft deletes with PostgreSQL and TypeORM

This entry is part 53 of 121 in the API with NestJS

In this series, we’ve implemented deleting functionalities for various entities. So far, it has always meant removing records permanently from our database. Instead, we can perform soft deletes. When we delete a record using a soft delete, we only mark it as deleted. You can find the code from this series in this repository. Soft […]