Supposed to be used in express nodejs applications.
Work in progress. Versions published are alpha still.
npm install @antonovicha/hdbext-async
Inside of you tsconfig.json
file include @sap/hdbext
and @sap/hana-client
typings provided by this package:
{
"compilerOptions": {
...
"baseUrl": ".",
"typeRoots": [
...
"./node_modules/@antonovicha/hdbext-async/dist/@types/@sap",
"./node_modules/@types",
...
],
}
}
import { HdbextAsync } from "@antonovicha/hdbext-async";
import * as hdbext from "@sap/hdbext";
hdbextAsync = new HdbextAsync(hdbext);
const connection = await hdbextAsync.createConnection(hanaOptions.hana);
const result1 = await connection.exec(sql, params, options);
const procedureFunction = await connection.loadProcedure(schema, procedureName);
const result2 = await procedureFunction([param1, param2]);
const result3 = await procedureFunction({ Param1: "something", Param2: 42 });
connection.close();