@ragarwal06/hana-orm
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@ragarwal06/hana-orm - SAP HANA Database Client Wrapper for NodeJS (with Typescipt Support)

Version Total Downloads License

Table of contents

Install

Install from npm:

npm install @ragarwal06/hana-orm

or clone from the GitHub repository to run tests and examples locally:

git clone https://github.com/ragarwal06/hana-orm.git
cd hana-orm
npm install

Getting started

If you do not have access to an SAP HANA server, go to the SAP HANA Developer Center and choose one of the options to use SAP HANA Express or deploy a new SAP HANA Cloud server.

This is a very simple example showing how to use this module in Javascript:

const hanaOrm = require("@ragarwal06/hana-orm");
const client = hanaOrm.createClient({
  host: "hostname",
  port: 30015,
  user: "user",
  password: "secret",
});
client.then(() => {
  const { insert, remove, find, update, prepareForTable } =
    hanaOrm.databaseOperations();
    
    insert({
      columnNames: ["name"],
      conditions: {
        name: "",
      },
      clause: "AND",
    })
});

This is a very simple example showing how to use this module in Typescript:

import { createClient, databaseOperations } from "@ragarwal06/hana-orm";
const client = createClient({
  host: "hostname",
  port: 30015,
  user: "user",
  password: "secret",
});

interface Users {
  name: string;
}

client.then(() => {
  const { insert, remove, find, update, prepareForTable } =
    databaseOperations();

  find<Users>({
    columnNames: ["name"],
    conditions: {
      name: "",
    },
    clause: "AND",
  });
});

This is a very simple example showing how to use this module in Express:

app.use(prepareClient({
  host: "hostname",
  port: 30015,
  user: "user",
  password: "secret",
}))
router.get('/user', async (req: Request, res: Response) => {
  const { insert, remove, find, update, prepareForTable } =
    req.db;
});

Contact

If you face any issue please write to owner or create a GitHub issue

For feature request please request here

Package Sidebar

Install

npm i @ragarwal06/hana-orm

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

90.6 kB

Total Files

66

Last publish

Collaborators

  • ragarwal06