# Enhancing Adabas Database Interactions with Node.js via Adabas TCP

**URL:** <https://techcommunity.softwareag.com/t/enhancing-adabas-database-interactions-with-node-js-via-adabas-tcp/279975>\
**Category:** Knowledge base\
**Tags:** Adabas-Natural, GitHub, Adabas, tutorial, Thursday-tricks\
**Created:** [July 13, 2023, 6:00am UTC](https://techcommunity.softwareag.com/t/enhancing-adabas-database-interactions-with-node-js-via-adabas-tcp/279975 "2023-07-13T06:00:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthias\_Gerth](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/matthias_gerth/32/103_2.png) [@Matthias\_Gerth](https://techcommunity.softwareag.com/u/Matthias_Gerth)\
**Post date:** [July 13, 2023, 6:00am UTC](https://techcommunity.softwareag.com/t/enhancing-adabas-database-interactions-with-node-js-via-adabas-tcp/279975/1 "2023-07-13T06:00:35Z")

</div>

## Introduction

 ![GitHub-logo](https://global.discourse-cdn.com/techcommunity/original/3X/2/8/2827ddafa45d9aad3c54f4ff581d046699e015fa.png)

The [Adabas TCP GitHub repository](https://github.com/SoftwareAG/adabas-tcp) 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.

> **[GitHub - SoftwareAG/adabas-tcp: Access to an Adabas Database from Node.js using...](https://github.com/SoftwareAG/adabas-tcp)**
>
> Access to an Adabas Database from Node.js using the 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](https://github.com/SoftwareAG/adabas-tcp/issues).
- 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](https://github.com/SoftwareAG/contributing).

## Useful links

- [Free Training Essentials for Adabas & Natural](https://techcommunity.softwareag.com/t/introducing-free-training-essentials-for-adabas-natural/259320)
- [Adabas TCP/IP Documentation](https://documentation.softwareag.com/adabas/ada671luw/remote/remote-adatcp.htm)
- [Open Source | Software AG](https://open-source.softwareag.com/)
