AnySQL
Modern minimal API for any SQL database.
Features
- Unified API for several database engines.
- No need to manage connections, just query the database.
- Easy transactions with automatic begin/commit/rollback.
- Asynchronous functions return promises, feel free to handle them with ES7 async/await feature.
Supported databases
- MySQL
- WebSQL (Chrome and Safari)
- SQLite (via CordovaSQLitePlugin)
- More to come (PR welcome!)
Installation
npm install --save anysql
Usage
Simple query
; let anysql = 'mysql://test@localhost/test';let rows = await anysql;console; // => 5
Transactions
; let anysql = 'mysql://test@localhost/test';await anysql;
License
MIT