0.0.3 • Published 11 months ago
dba v0.0.3
DBA.js
Mysql client framework in single file, inspired from medoo php framework.
Features
- INSERT/UPDATE operations with JS objects
- Automatically opening mysql transactions on multiline queries
- Variable type correction and automated sql escaping
- Synchronous operations with async/await (WIP)
Installation
$ npm i dba
Usage
const db = require("dba")({
"host": "localhost",
"user": "root",
"password": "<password>",
"database": "<database>"
});
db.insert('<table>', {"name": "PsyChip", "mail": "root@psychip.net"}, function (id) {
console.log(id); // row id
});
db.query("select * from <table>;", function (result) {
console.log(result); // [{"name": "PsyChip", "mail": "root@psychip.net"}]
});
Documentation
Not available yet
Contributions
Thanks to
- Kir Belevich kir@belevi.ch for providing this npm repository.
- @felixge who created the very first native mysql library around 2014.
- @catfan creator of medoo framework.