# arya-dbconnect

> Arya dbconnect is the node library to manage DB Connections with capillary DB services

Latest version **1.1.1** (published 2017-05-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install arya-dbconnect
pnpm add arya-dbconnect
yarn add arya-dbconnect
bun add arya-dbconnect
```

## 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.1.1 |
| Published | 2017-05-11 |
| First published | 2017-05-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4.2.4 |
| Dependencies | 7 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Nayan Patel |
| Maintainers | capillary |
| Keywords | dbconnect, arya, mysql |

## Links

- npm: https://www.npmjs.com/package/arya-dbconnect
- Repository: https://github.com/Capillary/arya-dbconnect
- Homepage: https://github.com/Capillary/arya-dbconnect#readme
- Issues: https://github.com/Capillary/arya-dbconnect/issues
- npm.io page: https://npm.io/package/arya-dbconnect

## Dependencies (7)

- [mysql](https://npm.io/package/mysql.md) ^2.11.1
- [redis](https://npm.io/package/redis.md) ^2.6.2
- [promise](https://npm.io/package/promise.md) ^7.1.1
- [bluebird](https://npm.io/package/bluebird.md) ^3.4.6
- [node-ini](https://npm.io/package/node-ini.md) ^1.0.0
- [underscore](https://npm.io/package/underscore.md) ^1.8.3
- [node-libcurl](https://npm.io/package/node-libcurl.md) ^1.0.0

## Recent versions

- 1.1.1 (latest) — 2017-05-11
- 1.1.0 — 2017-05-11

## README

Arya DB Connect
=========

A library that handles db operations of capillary db services with shard support

## Installation
   
   add dependency package in your package.json.
   
   {"arya-dbconnect": "git@github.com:Capillary/arya-dbconnect.git"}
   
  `npm install arya-dbconnect` [don't use it for now] [TODO]

## Usage

    var DBase = require('arya-dbconnect');

    var dObject = new DBase({dbname:"authorization"});
	
	1. Output should be number of affected rows 
		
		dObject.query("select * from {{table}} where id = ?",[{{id}}])
	    	.then(function(rows){
	        	console.log(rows);
	    	});

	2. Output should be latest inserted id

		dObject.insert(
			"INSERT INTO {{table}} (`name`) VALUES (?)",['nayan1'])
		    .then(function(rows){
	        	console.log(rows);
	     	});

    3. Output should be true or false

		dObject.update(
			"UPDATE {{table}} SET {{col}}=? where id = ?",["{{value}}","{{id}}"])
	     	.then(function(rows){
	        	console.log(rows);
	    	});

    4. Output should be number of affected rows 

		DBase.queryForOrg(
			"select * from {{table}} where id = ?",[{{id}}],
	    	{
	    		"orgId":{{orgId}},
	    		dbname:"{{dbname}}",
	    		slave:{{true|false}}(optional)
	    	})
		    .then(function(rows){
		        console.log(rows);
		    });

    5. Output should be true or false

	    DBase.updateForOrg(
	    	"UPDATE {{table}} SET {{col}}=? where id = ?",["{{val}}","{{id}}"],
	     	{
		    		"orgId":{{orgId}},
		    		dbname:"{{dbname}}",
		    		slave:{{true|false}}(optional)
		    })
	     	.then(function(rows){
	        	console.log(rows);
	     	});

## Tests

  `npm test`

## Contributing

In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

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