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

sync-mysql

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sync-mysql

Make synchronous queries to a mysql database

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
937
decreased by-19.22%
Maintainers
1
Weekly downloads
 
Created
Source

sync-mysql

Make synchronous queries to a mysql database

Build Status Dependency Status NPM version

Installation

npm install sync-mysql --save

Usage

var MySql = require('sync-mysql');

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

const result = connection.query('SELECT 1 + 1 AS solution');
assert(result[0].solution === 2);

API

connection.getRecord(tableName, id)

Assuming that the table passed has an id column, get the record with that id.

connection.query(str, values)

Return 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.

connection.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.

License

MIT

FAQs

Package last updated on 03 Jan 2017

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