Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

then-mysql

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

then-mysql

A wrapper for the MySQL driver to use promises, connection pooling and nicer APIs all round

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1K
increased by2.31%
Maintainers
1
Weekly downloads
 
Created
Source

then-mysql

A wrapper for the MySQL driver to use promises, connection pooling and nicer APIs all round

Build Status Dependency Status NPM version

Installation

npm install then-mysql

API

To construct a new connection pool, simply run:

var pool = new MySql({
  host: 'localhost',
  user: 'me',
  passowrd: 'secret'
});

pool.query('SELECT 1 + 1 AS solution').done(function (result) {
  assert(result[0].solution === 2);
  pool.dispose().done();
});

pool.query(str, values)

Return a promise for an array of objects from a SQL query. The query may optionally contain ?s to be replaced with escaped values from values which should be an array.

pool.call(name, args)

Call a database procedure. If it returns only one set of values, that set of values is returned as an array of objects. If it returns multiple sets of values then they are returned as an array.

e.g.

pool.call(addprocedure, [1, 2]).done(function (result) {
  assert(result[0].solution === 3);
});

License

MIT

Keywords

FAQs

Package last updated on 27 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc