Nestjs Dbvalidator

screenshot of Nestjs Dbvalidator
nestjs

nestjs DbValidator Module has some database check validation

Overview

The nestjs-DbValidator module is an essential tool for developers working with NestJS applications. This module offers a robust solution for implementing custom database validation through the integration of class-validator and typeorm. It simplifies the process of ensuring that your data adheres to specific validation rules before it interacts with the database, thus enhancing overall data integrity. Specifically designed for use with NestJS, the module streamlines validation and offers flexibility for handling various database scenarios.

Features

  • Custom Validators: Includes built-in validators such as isExistDb to ensure that values already exist within a designated table.
  • Uniqueness Check: The isUniqueDb validator allows developers to easily enforce uniqueness for specific database entries.
  • Comparative Checks: Validators like isLowerDb and isBiggerDb enable comparisons, which are useful for checks like client credit limits or stock levels.
  • Array Handling: The ability to use IsArray for both isExistDb and isUniqueDb checks means you can validate multiple values at once.
  • Configurable Error Messages: The module allows for customized error messages, enhancing user experience by providing clearer feedback in case of validation failures.
  • Dynamic Type Support: With version 2.0, users can change the data type for validation using predefined enumerations, offering greater flexibility in validation rules.
  • Comprehensive Documentation: The module comes with detailed usage examples and parameter descriptions, making it easy for developers to implement the validators in their projects.
  • Compatibility: Specifically designed to be compatible with NestJS, ensuring seamless integration with existing applications.
nestjs
Nest

A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript.

eslint
Eslint

ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.