Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sap/hana-client

Package Overview
Dependencies
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sap/hana-client

Official SAP HANA Node.js Driver

  • 2.10.20
  • npm
  • Socket score

Version published
Weekly downloads
94K
decreased by-22.66%
Maintainers
1
Weekly downloads
 
Created

What is @sap/hana-client?

@sap/hana-client is an npm package that provides a client interface for connecting to and interacting with SAP HANA databases. It allows developers to execute SQL queries, manage database connections, and handle transactions programmatically.

What are @sap/hana-client's main functionalities?

Connecting to SAP HANA

This feature allows you to establish a connection to an SAP HANA database using the provided connection parameters.

const hana = require('@sap/hana-client');
const conn = hana.createConnection();
const connParams = {
  serverNode: 'myServer:30015',
  uid: 'myUser',
  pwd: 'myPassword'
};
conn.connect(connParams, (err) => {
  if (err) throw err;
  console.log('Connected to SAP HANA');
});

Executing SQL Queries

This feature allows you to execute SQL queries against the connected SAP HANA database and retrieve the results.

const sql = 'SELECT * FROM MY_TABLE';
conn.exec(sql, (err, result) => {
  if (err) throw err;
  console.log(result);
});

Handling Transactions

This feature allows you to manage transactions by explicitly committing or rolling back changes to the database.

conn.setAutoCommit(false);
conn.exec('INSERT INTO MY_TABLE (ID, NAME) VALUES (1, 'John Doe')', (err) => {
  if (err) {
    conn.rollback();
    throw err;
  }
  conn.commit((err) => {
    if (err) throw err;
    console.log('Transaction committed');
  });
});

Other packages similar to @sap/hana-client

Keywords

FAQs

Package last updated on 16 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc