Socket
Socket
Sign inDemoInstall

@sap/hana-client

Package Overview
Dependencies
Maintainers
3
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sap/hana-client

HANA JavaScript Driver.


Version published
Weekly downloads
97K
decreased by-20.76%
Maintainers
3
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

FAQs

Package last updated on 10 Jun 2020

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc