NestJS

API with NestJS #156. Arrays with PostgreSQL and the Drizzle ORM

This entry is part 156 of 166 in the API with NestJS

Thanks to some of its features, PostgreSQL sets itself apart from other SQL databases. Unlike many SQL databases that limit columns to single entries, PostgreSQL lets us store multiple values in a single column. This simplifies database design and can improve performance. In this article, we will explore the practical uses of arrays in PostgreSQL […]

NestJS

API with NestJS #155. Offset and keyset pagination with the Drizzle ORM

This entry is part 155 of 166 in the API with NestJS

As our database grows, maintaining good performance becomes more important. Returning large amounts of data at once through our API can negatively affect efficiency. A common solution is to divide data into smaller chunks, presenting it to the user as infinite scrolling or multiple pages. In this article, we implement this approach using PostgreSQL and […]

NestJS SQL

API with NestJS #154. Many-to-many relationships with Drizzle ORM and PostgreSQL

This entry is part 154 of 166 in the API with NestJS

Creating relationships across tables is a crucial aspect of working with SQL databases. Previously, this series focused on using the Drizzle ORM to create simple relationships, such as one-to-one and many-to-one relationships. In this article, we learn about many-to-many relationships, which are slightly more complex. Introducing many-to-many relationships A many-to-many relationship is necessary when multiple […]

NestJS SQL

API with NestJS #153. SQL transactions with the Drizzle ORM

This entry is part 153 of 166 in the API with NestJS

Ensuring the integrity of the data is a fundamental responsibility of each developer. Fortunately, SQL databases give us the tools to ensure our database stays consistent and accurate. A crucial scenario to consider is when two SQL queries depend on each other. A typical example is transferring money between two bank accounts. Suppose we have […]

NestJS SQL

API with NestJS #152. SQL constraints with the Drizzle ORM

This entry is part 152 of 166 in the API with NestJS

When working with SQL databases, we can configure constraints to ensure our data does not get corrupted. In this article, we explore and implement different SQL constraints using PostgreSQL, NestJS, and the Drizzle ORM. Not-null constraint By default, SQL columns can hold nulls, representing an absence of value. We need the not-null constraint using the […]

NestJS SQL

API with NestJS #151. Implementing many-to-one relationships with Drizzle ORM

This entry is part 151 of 166 in the API with NestJS

Managing relationships between tables is a significant part of dealing with SQL databases. In this article, we continue learning to use Drizzle ORM with NestJS and implement many-to-one relationships. Check out this repository if you want to see the full code from this article. The many-to-one relationship With many-to-one relationships, a row from the first […]

NestJS SQL

API with NestJS #150. One-to-one relationships with the Drizzle ORM

This entry is part 150 of 166 in the API with NestJS

When building a database, the tables we set up often connect to each other. Managing these relationships is one of the crucial parts of working with databases. In the previous article, we learned how to use NestJS with Drizzle to set up a simple project with PostgreSQL. This time, we go further and write more […]

JavaScript React Testing

Drag and Drop with React. Writing E2E tests using Playwright

Web applications are becoming increasingly complex. While that’s the case, we must ensure the interface is intuitive and easy to use. By allowing our users to drag and drop elements across the screen, we can simplify many tasks, such as reordering lists or grouping items. In this article, we learn how to implement the drag-and-drop […]