Enhancing Adabas Database Interactions with Node.js via Adabas TCP

Introduction

The Adabas TCP GitHub repository is a resourceful tool for developers working with the Adabas database system through Node.js. This library simplifies and enhances the interactions with Adabas databases, providing essential CRUD operations (Create, Read, Update, Delete) over an Adabas TCP connection.

Installation and Setup

Installation of the module is hassle-free with npm (Node Package Manager). A simple command npm install adabas-tcp integrates the library into any Node.js project.

High-Level API and Data Representation

When it comes to data representation, the library smartly uses Javascript objects to depict Adabas data. The API’s read method returns a Javascript object, while the insert and update methods require a Javascript object as input, ensuring efficient data interactions. The type checking during processing guarantees compatibility, with type mismatches resulting in errors.

Data Structures

For data structures, the library represents multiple fields as arrays, groups as Javascript objects, and periodic groups as arrays of Javascript objects. This clear and concise representation aligns with the structure of Adabas databases, making data processing and manipulation straightforward.

Primary Classes: AdabasMap and Adabas

The library defines two primary classes: AdabasMap and Adabas. The AdabasMap class hosts metadata for the Adabas call, including field information. The Adabas class is responsible for executing Adabas calls. The Adabas class constructor demands a database number and allows additional options for multifetch or logging.

Both Adabas and AdabasMap classes can be imported into your project using Javascript’s require function or Typescript’s import function.

CRUD Operations and Transaction Control

For executing CRUD operations, the Adabas class methods require a map or a file number as a parameter. These methods allow you to create, read, update, and delete records efficiently. The methods also support transaction control, enabling users to commit or back out from transactions.

Limitations and Disclaimer

The library currently does not support Alpha fields with length 0 and LOB fields.
As per the disclaimer, the Adabas TCP is not an official part of Software AG products and doesn’t come with official technical assistance. Therefore, developers are advised to consider it as a “working example” and to test their solutions thoroughly.

Feedback and Ideas

  • If you find any bug, please raise an issue directly in the GitHub repository.
  • If you have any ideas, feedback or comments post them as a reply here.
  • Contributions are welcome, but first check out our GitHub contributing guides.

Useful links