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

egg-sy-node-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-sy-node-mysql

mysql builder plugin > 依赖 sy-node-mysql

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

egg-sy-node-mysql

mysql builder plugin

依赖 sy-node-mysql

npm package

Getting Started

$ npm install sy-node-mysql --save

开启插件

// config/plugin.js
exports.nodeMysql = {
  enable: true,
  package: 'egg-sy-node-mysql',
};

//config.default.js
exports.nodeMysql = {
   clients: [
    {
      name: 'TEST_DATABASE',
      database: 'db_one',
      port: 3306,
      host: '127.0.0.1',
      user: 'root',
      password: 'root',
      charset: 'UTF8MB4_GENERAL_CI',
      connectionLimit: 50,
    },
    {
      name: 'TEST_DATABASE',
      readonly: true,
      database: 'db_one',
      port: 3307,
      host: '127.0.0.1',
      user: 'root',
      password: 'root',
      charset: 'UTF8MB4_GENERAL_CI',
      connectionLimit: 100,
    },
  ],
  app: true,   // default true
  agent: false,   // default false
};

使用插件

参考 sy-node-mysql

const pool = app.mysql.get('TEST_DATABASE');
await pool.query(sql, opts);

//the same as
await app.mysql.query(sql, opts, 'TEST_DATABASE');

Keywords

FAQs

Package last updated on 11 May 2019

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