Nest Qldb

screenshot of Nest Qldb
nestjs

Object Document Mapper connecting NestJS to QLDB Quantum Ledger Database

Overview

NestQldb is an extension of the amazon-qldb-driver-nodejs that adds Object Document Mapping (ODM) functionality tailored for use within NestJS applications. It simplifies the process of integrating with Amazon's Quantum Ledger Database (QLDB), making it easier for developers to manage data with a set of intuitive tools and features. This module promotes a clean architecture through its dependency injection facilities and promotes seamless CRUD operations, ultimately streamlining the development of applications that require robust data management.

With the introduction of auto-generated repositories and a clean querying layer, NestQldb elevates the efficiency and clarity of interaction with QLDB. Whether you're looking to implement simple CRUD functionalities or complex query structures, NestQldb provides an elegant solution that fits perfectly within the NestJS ecosystem.

Features

  • Simple Dependency Injection: Integrates with NestJS using NestQldbModule.forRoot() and NestQldbModule.forRootAsync(), allowing for straightforward setup and configuration.

  • Auto-Generated CRUD Repositories: Automatically creates CRUD repositories for your models, easily injectable via @InjectRepository(model) to streamline database interactions.

  • Dapper-Inspired Query Layer: Offers a QldbQueryService provider that simplifies querying, allowing developers to write clean and efficient queries that map directly to JSON objects.

  • Model Registration: Utilizes the @QldbTable() decorator for model classes to define the shape of data, ensuring they are bound to corresponding QLDB tables with options to set table name and indexes.

  • Flexible Index Creation: Indexes can be defined during model registration, but they must be created on empty tables for optimal performance, alongside configuration options for table creation and index management.

  • Robust Transaction Handling: Supports batch operations with createMany(data: T[]), efficiently saving multiple records in transactional batches, ensuring data integrity.

  • Comprehensive History Tracking: The history(id: string) method allows for easy fetching of all document versions, showcasing the entire change history stored in the ledger.

  • Metadata Handling: Provides options to manage how key fields are utilized within QLDB metadata, allowing developers to customize data handling as per their application needs.

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.