Logo

dev-resources.site

for different kinds of informations.

Announcing Version 2.0 of nestjs-DbValidator

Published at
4/5/2024
Categories
nestjs
node
typeorm
opensource
Author
youba
Categories
4 categories in total
nestjs
open
node
open
typeorm
open
opensource
open
Author
5 person written this
youba
open
Announcing Version 2.0 of nestjs-DbValidator

We are excited to unveil version 2.0 of nestjs-DbValidator, a feature-packed module providing custom database validators using class-validator and typeorm for Nest.js applications. This latest release comes with an array of enhancements, new features, and bug fixes, making it even more versatile and compatible with the latest Nest.js versions.

What's New in Version 2.0

  1. Custom Type Support In version 2.0, we introduce the ability to customize the type of the column for validation. Now you can specify the type using the customType parameter, allowing for more flexibility in handling different data types.
@isExistDb({ table: 'user', column: 'firstName', customType: TYPECOLUMN.STRING })idcities: any;
Enter fullscreen mode Exit fullscreen mode

2. Nest.js 9 and Above Compatibility We are excited to announce that nestjs-DbValidator has been upgraded to support Nest.js version 9 and above. This ensures seamless integration with the latest features and improvements introduced in the Nest.js framework. Thanks to @DevDeNiro for their significant contribution in the upgrade.

To upgrade to version 2.0, simply update your package using the following command:

Getting Started with Version 2.0

npm update @youba/nestjs-dbvalidator# oryarn upgrade @youba/nestjs-dbvalidator
Enter fullscreen mode Exit fullscreen mode

After updating, be sure to check the documentation for any additional configuration changes and new features introduced in this release.

A Brief Review of nestjs-DbValidator

Overview

nestjs-DbValidator is a Nest.js module that simplifies database validation in your applications. It leverages the power of class-validator and typeorm to offer a seamless and intuitive way to validate data against your database.

Key Features

isExistDb : Checks if a value already exists in the specified table and column. isUniqueDb : Verifies if a value is unique within the specified table and column. isLowerDb : Validates if a value is lower, useful for scenarios such as checking client credits.

isBiggerDb : Validates if a value is bigger, suitable for cases like checking stock levels.

Easy Integration

The library is easy to integrate into your Nest.js application. By adding a few lines of code, you can enhance the validation capabilities of your DTOs and entities.

Version 2.0 Improvements Version 2.0 builds upon the success of the previous release by introducing custom-type support and ensuring compatibility with Nest.js 9 and above.

Conclusion

Feel free to provide feedback, report issues, or contribute to the project on GitHub.

Happy coding!

typeorm Article's
30 articles in total
Favicon
Creating Typescript app with decorator-based dependency injection 💉
Favicon
ORM and Migrating/Adding Data to MySql Database from MongoDb using TypeOrm in javaScript
Favicon
🌟 NestJS + Databases: Making Snake Case Seamless!🐍
Favicon
NestJS TypeORM and Multi-Tenancy
Favicon
Nx + TypeORM + NestJS + Migrations
Favicon
Handling TypeORM migrations in Electron apps
Favicon
How to manage multiple environments with dotenv and Databases config in NestJS
Favicon
Sveltekit + TypeScript + TypeORM + ESM
Favicon
Using TypeORM with TSX: A Smoother Development Experience
Favicon
Prisma or TypeORM ?
Favicon
Mock TypeORM Package
Favicon
Connecting a Serverless PostgreSQL Database (Neon) to NestJS Using the Config Service
Favicon
NestJS and TypeORM — Efficient Schema-Level Multi-Tenancy with Auto Generated Migrations: A DX Approach
Favicon
Getting Started with NestJS and TypeORM: A Beginner's Guide
Favicon
Migration - Module query with TypeORM version 0.3.x
Favicon
Double bind the foreign key to avoid unnecessary JOIN in TypeORM
Favicon
Handling Migrations on NestJS with TypeORM
Favicon
match all conditions in the first array and at least one condition for the second array typeorm
Favicon
Taming cross-service database transactions in NestJS with AsyncLocalStorage
Favicon
Announcing Version 2.0 of nestjs-DbValidator
Favicon
Optimizing SQL Queries by 23x!!!
Favicon
Building my own PostgresGUI with TypeORM+TypeGraphQl class generaion
Favicon
TypeORM | Query Builder
Favicon
NestJs에서 TypeORM을 사용하여 MySQL 연동, 2024-01-25
Favicon
Defining Custom Many-to-many Relationship in NestJS TypeORM.
Favicon
4. Building an Abstract Repository
Favicon
3. Building a Common Repository for Nest.js Microservices
Favicon
TypeORM - remove children with orphanedRowAction
Favicon
Migrating NestJS project with TypeORM to Prisma
Favicon
Authentication part 2 using NestJS

Featured ones: