
Wanago » TypeScript
113 FOLLOWERS
Wanago features blog series like TypeScript Express Tutorial, API with NestJS, JavaScript design patterns, and more useful articles. Wanago is a JavaScript blog focused on covering practical issues and explaining how the language works under the surface.
Wanago » TypeScript
2w ago
When building a REST API, we must prepare for various cases. At first, everything might run smoothly, but as our API gains traction, we might encounter some issues. We might run into users who begin sending hundreds or thousands of requests per second, pulling data far more often than necessary. This might cause our server […]
The post API with NestJS #187. Rate limiting using Throttler appeared first on Marcin Wanago Blog - JavaScript, both frontend and backend ..read more
Wanago » TypeScript
1M ago
With NestJS 11, the framework now comes with Express 5 by default. While the update is mostly painless, there are some breaking changes to consider. In this article, we go through what new features Express 5 brings to the table and how it affects NestJS. Installing Express 5 Express 4 was released in April 2014. […]
The post API with NestJS #186. What’s new in Express 5? appeared first on Marcin Wanago Blog - JavaScript, both frontend and backend ..read more
Wanago » TypeScript
1M ago
When using PostgreSQL with PostGIS, we can do various operations using polygons. In this article, we learn how to do that both through raw SQL queries and the Drizzle ORM. Storing polygons using the Drizzle ORM To store polygons using the Drizzle ORM, we use a custom data type and the [crayon-679a9ab48dd05548988302-i/] table. database-schema.ts [crayon-679a9ab48dd08184946482/] […]
The post API with NestJS #185. Operations with PostGIS Polygons in PostgreSQL and Drizzle appeared first on Marcin Wanago Blog - JavaScript, both frontend and backend ..read more
Wanago » TypeScript
2M ago
PostgreSQL, together with PostGIS, allows us to store various types of geographical data. Besides working with simple coordinates, we can also store entire areas in the form of polygons. In this article, we learn how to handle polygons with PostgreSQL and the Drizzle ORM. While Drizzle ORM does not support it out of the box, we […]
The post API with NestJS #184. Storing PostGIS Polygons in PostgreSQL with Drizzle ORM appeared first on Marcin Wanago Blog - JavaScript, both frontend and backend ..read more
Wanago » TypeScript
2M ago
PostgreSQL provides many options for working with geographical data, especially with the PostGIS extension. In this article, we’ll explore how to calculate the distance between two coordinates and how to identify locations within a specific radius. If you want to check out the basics of storing coordinates in PostgreSQL with the Drizzle ORM, check out […]
The post API with NestJS #183. Distance and radius in PostgreSQL with Drizzle ORM appeared first on Marcin Wanago Blog - JavaScript, both frontend and backend ..read more
Wanago » TypeScript
2M ago
Many applications rely on geographical data to calculate distances and track locations. PostgreSQL offers several ways to store geospatial data, each designed with different goals. In this article, we learn how to store coordinates when working with PostgreSQL and the Drizzle ORM. Latitude and longitude A coordinate consists of two numbers that pinpoint a location […]
The post API with NestJS #182. Storing coordinates in PostgreSQL with Drizzle ORM appeared first on Marcin Wanago Blog - JavaScript, both frontend and backend ..read more
Wanago » TypeScript
2M ago
When we execute an SQL query, PostgreSQL follows a process that consists of multiple steps. First, it parses the SQL statement, checking for syntax errors. Next, it analyzes whether the tables and columns used in the query exist. Then, it plans the instructions necessary to achieve the desired result. Finally, it executes the instructions based on […]
The post API with NestJS #181. Prepared statements in PostgreSQL with Drizzle ORM appeared first on Marcin Wanago Blog - JavaScript, both frontend and backend ..read more
Wanago » TypeScript
3M ago
As our application grows, it gets increasingly important to create a file structure that’s easy to maintain. Also, if we care about it from the start, it is easier to achieve. In this article, we learn how to organize the database schema when working with the Drizzle ORM and NestJS. Handling column names When working […]
The post API with NestJS #180. Organizing Drizzle ORM schema with PostgreSQL appeared first on Marcin Wanago Blog - JavaScript, both frontend and backend ..read more
Wanago » TypeScript
3M ago
Searching through text documents is a very common feature in many web applications. In this article, we learn how to implement it using pattern matching using the Drizzle ORM, PostgreSQL, and NestJS. Pattern matching with LIKE and ILIKE With pattern matching, we can determine if a given piece of text matches a particular pattern. To […]
The post API with NestJS #179. Pattern matching search with Drizzle ORM and PostgreSQL appeared first on Marcin Wanago Blog - JavaScript, both frontend and backend ..read more
Wanago » TypeScript
3M ago
When fetching data from the database, we often don’t want to present it to the user in its raw form. To prevent that, we need to serialize the response in NestJS before sending it. The most popular way to achieve that in NestJS is using the [crayon-6753379cd371c852771052-i/] library. In this article, we explain how to […]
The post API with NestJS #177. Response serialization with the Drizzle ORM appeared first on Marcin Wanago Blog - JavaScript, both frontend and backend ..read more