dba
v0.0.3
Published
Production ready mysql client framework in single file.
Downloads
16
Maintainers
Readme
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": "[email protected]"}, function (id) {
console.log(id); // row id
});
db.query("select * from <table>;", function (result) {
console.log(result); // [{"name": "PsyChip", "mail": "[email protected]"}]
});
Documentation
Not available yet
Contributions
Thanks to
- Kir Belevich [email protected] for providing this npm repository.
- @felixge who created the very first native mysql library around 2014.
- @catfan creator of medoo framework.