Build DB abstraction layer for mysql and postgres as a local module in node.js using async/await promises
$10-30 USD
ปิดแล้ว
โพสต์ มากกว่า 2 ปีที่ผ่านมา
$10-30 USD
ชำระเงินเมื่อส่งงาน
Hi,
I would like to have a simple local module that abstracts basic DB I/O functions for mysql and postgres using the async/await promises pattern. Later this is extended to DB drivers for Oracle and other RDBMS.
Delivery expectations:
- [login to view URL] for the mysql implementation
- [login to view URL] for the postgres implementation
- [login to view URL] with any required db configs to be included in the db-*.js files
- use connection pools, prepared statements and error handling
- [login to view URL] with simple GET route (/test) for me to test that your implementation is working
Intended usage:
[login to view URL]
// implements DB abstraction layer for mysql (later the same pattern is used for Oracle, Postgres, Microsoft SQL etc.
// export for usage as a local module
// take all db connection and other configurations from [login to view URL] file
[login to view URL]
{
// contains connection details, e.g.
"host" : "localhost", ...
}
usage in [login to view URL]:
const db = require("mysql-db");
let con = [login to view URL](); //create connection pool and get a connection
let query = "select * from table where field=?or other_field=?;"; // or other query for insert/update/delete
let params = ["condition1", "condition2"]; // array of values for query
// must use prepared statements
let result = await [login to view URL](query, params);
let result = await [login to view URL](query, params);
let result = await [login to view URL](query, params);
let last_id = [login to view URL];
let result = await [login to view URL](query, params);
// error handling
HELLO SIR/MAM
Are you looking for NODE JS Developer. I am fullstack developer. I have good knowledge of Node JS, Express JS, MYSQL, Postgresql and more.
I have very strong experience in this field.
I really like help you!
Thanks;