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
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;
});
If you face any issue please write to owner or create a GitHub issue
For feature request please request here