# finemysql

> A tiny mysql wrapper that adds capabilities of immutability, promises, and carefree connections management.

Latest version **1.0.0** (published 2016-09-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install finemysql
pnpm add finemysql
yarn add finemysql
bun add finemysql
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-09-25 |
| First published | 2016-09-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Ran Cohen |
| Maintainers | rannn505 |
| Keywords | mysql, sql, node-mysql, node-sql, db, oracle, db-mysql, node-db |

## Links

- npm: https://www.npmjs.com/package/finemysql
- Repository: https://github.com/rannn505/finemysql
- Homepage: https://github.com/rannn505/finemysql#readme
- Issues: https://github.com/rannn505/finemysql/issues
- npm.io page: https://npm.io/package/finemysql

## Dependencies (3)

- [mysql](https://npm.io/package/mysql.md) ^2.11.1
- [bluebird](https://npm.io/package/bluebird.md) ^3.4.5
- [immutable](https://npm.io/package/immutable.md) ^3.8.1

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [@temporal-architect/claude-plugin](https://npm.io/package/@temporal-architect/claude-plugin.md) — 335 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-09-25

## README

<img height="64" width="64" src="https://raw.githubusercontent.com/rannn505/finemysql/master/assets/finemysql.png"> finemysql
===

[![Version npm](https://img.shields.io/npm/v/finemysql.svg?style=flat-square)](https://www.npmjs.com/package/finemysql)[![NPM Downloads](https://img.shields.io/npm/dt/finemysql.svg?style=flat-square)](https://www.npmjs.com/package/finemysql)[![Dependencies](https://img.shields.io/david/rannn505/finemysql.svg?style=flat-square)](https://david-dm.org/rannn505/finemysql)

>  A tiny mysql wrapper that adds capabilities of immutability, promises, and carefree connections management.

## Installation
```bash
$ npm i -S finemysql
```


## Quick start
```javascript
const mysql = require('../dist/index');

const db = new mysql({user: 'test', password: 'test', database: 'test'});

db.invoke('SELECT * FROM test')
    .then(data=> {
        console.log(data);
        console.log(data.isList()); //immutable Data
        console.log(data.first());
    });
```


## Goal

finemysql was created just to simplify the use of [nodejs driver for mysql][mysql].
it uses [bluebirdjs][] to convert old callbacks to promises, and [immutablejs][] to keep your data reliable and consistent throughout your app.
all those, along with a done right connections management, allow you to use [mysql][] easier than ever before. Enjoy!
[mysql]: https://www.npmjs.com/package/mysql
[bluebirdjs]: http://bluebirdjs.com/docs/getting-started.html
[immutablejs]: https://facebook.github.io/immutable-js/


## API

### DB Class `require('finemysql')`

#### initialize(constructor):
Creates a new db instance.
```javascript
const db = new mysql(options);
```
***for the options list please refer to [mysql module docs](https://www.npmjs.com/package/mysql#connection-options).***

#### Methods:
| Name     | Description                                           | Syntax                            | Return Value                                                                          |
|----------|-------------------------------------------------------|-----------------------------------|---------------------------------------------------------------------------------------|
| invoke() | Runs the query with the escapeArr on the db instance. | db.invoke(query, escapeArr = []); | A promise with the result (Immutable collection) (can also be rejected to the catch). |


## Examples

***for examples please look at the [example page](https://github.com/rannn505/finemysql/blob/master/example/example.js).***


## License

  [MIT](LICENSE)

---
_Source: https://npm.io/package/finemysql · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
