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

egg-real-mysql

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

egg-real-mysql

based on node mysql and promise-mysql

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

egg-real-mysql

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Description

this plugin based on promise-mysql package, and promise-mysql based on node-mysql, so you can simply use it

the version on EggJs

egg-real-mysql versionegg 2.x
2.x😁
1.x
0.x

Install

$ npm i egg-real-mysql --save

Usage

// {app_root}/config/plugin.js
exports.realMysql = {
  enable: true,
  package: 'egg-real-mysql',
};

Configuration

// {app_root}/config/config.default.js
exports.mysql = {
    client: {
        host: '127.0.0.1',
        port: '3306',
        user: 'root',
        password: 'root',
        database: 'example',
    },
    app: true,
    agent: false,
};

see config/config.default.js for more detail.

use on service

module.exports = app => {
    return class extends app.Service {
        async create(name) {
            let data = {
                id: '',
                name: name
            };
            const result = await this.app.mysql.query('insert into list set ?', [ data ]).then(rows => {
                return JSON.parse(JSON.stringify(rows));
            });
            return result;
        }
    };
};

## Questions & Suggestions

Please open an issue

## License

[MIT](LICENSE)

Keywords

FAQs

Package last updated on 07 Apr 2018

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