{"_id":"@busyhe/ynn-plugin-mysql","_rev":"1-301be2e3eb2b2e4331dc03e5120bfae3","name":"@busyhe/ynn-plugin-mysql","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@busyhe/ynn-plugin-mysql","version":"0.0.1","description":"Ynn plugin for MySQL","main":"lib/index.js","scripts":{"test":"jest --forceExit","tw":"jest --watch","test-watch":"npm run tw","test-cov":"jest --coverage --runInBand --forceExit --detectOpenHandles","lint":"eslint lib --cache --ignore-path .eslintignore","precommit-msg":"echo 'Pre-commit checks...' && exit 0"},"repository":{"type":"git","url":"git+ssh://git@github.com/busyhe-ynn-plugins/plugin-mysql.git"},"keywords":["ynn","plugin","database","mysql","db"],"author":{"name":"LvChengbin","email":"lvchengbin59@gmail.com"},"bugs":{"url":"https://github.com/ynnjs/ynn-plugin-mysql/issues"},"homepage":"https://github.com/ynnjs/ynn-plugin-mysql#readme","dependencies":{"mysql2":"^2.1.0"},"devDependencies":{"eslint":"^7.3.1","jest":"^26.1.0","pre-commit":"^1.2.2","ynn":"0.1.1"},"jest":{"testMatch":["**/test/**/*.spec.js"],"coverageReporters":["text-summary","text","lcov"],"collectCoverageFrom":["lib/**/*.js"],"testEnvironment":"node"},"gitHead":"09bb499bf185842c1a955e749f418298d3a12fc7","_id":"@busyhe/ynn-plugin-mysql@0.0.1","_nodeVersion":"12.12.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-70KYsCKtyCqFP30rEhrcJ7RSuks55Y2b5InCoBJmt0qLJyPvMNFqwTaUZKYLmWH0vwpcYe3ayAkJBI7UazH0Dw==","shasum":"bc0b4750629cc89933548f05599fab3f92791ea0","tarball":"https://registry.npmjs.org/@busyhe/ynn-plugin-mysql/-/ynn-plugin-mysql-0.0.1.tgz","fileCount":8,"unpackedSize":6117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/wM5CRA9TVsSAnZWagAA6jUP/3m/f1OAclh3aba7lKLC\nb+QKjh08r022nIzq7s2nTVbyBxImlK1FVu5ndjvzzT07G1bqRwlTrAfyYX+D\n+dUJvX84UCaKVw8yoD0SJStoYJDeJLEh4RPzdQ9XFrsjR0c0W2fxdGd6xzaD\n6eBN4K6/IowsQDVpzERdJYXUFG4/6lnLlNaj4YbcjfMrgOf1x4Vaa3+pqvVm\nLKc7pW+e1zvP7c75Rz76skvjoXu/07C+Eqg7MntxbwdGBNw04589bmaMFSbS\nQ0sm1qfvy4PRiBUidA7z1IlFLBOIADC5SqkfnciIQi90lpD7nRqy72f1o2+u\nu6SxhcJ6dkU/+ngm7GEf6XwBNsq565Yz5TutzBCuu+TLsxaaUzdf03fzIvwd\n5vRl7jgARTDwEmSHNmlOvbE05aye2YN9K32oJqMCiACDk6brknYfab++21ck\n3+OiG/509odz6EoW1fIg7xAxWJQh+oTHIxmjw4Q69jEzWybK2p/k2//yRFJw\n81YNHDZMOy3N1prdhPB1Mjpx1hiRua19QMElliTo3zk+WPNx4EOZJ3UdSvw2\nYL0uquU/vAhYBF8J2zjs13w4lbdYWWOyruJauQt4U4MPvFhqzXLdWRaau9DS\nEeLR/6q0b6a+M4PRFdcZzif6YAp+3cq2+9ryiQSzqViZqg0/uGAUzEbpqsvy\nd5YK\r\n=/QrQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgXG69LqyxmhUImwY2v9DmcTo7jqKPAbGIzyIkLcFRsgIgGrc2acOD79pcbZ99njuQTiERx403TY/KgJ6Gg+qN9Ho="}]},"maintainers":[{"name":"busyhe","email":"525118368@qq.com"}],"_npmUser":{"name":"busyhe","email":"525118368@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ynn-plugin-mysql_0.0.1_1593770808635_0.5346188210118055"},"_hasShrinkwrap":false}},"time":{"created":"2020-07-03T10:06:48.602Z","0.0.1":"2020-07-03T10:06:48.807Z","modified":"2022-04-04T21:09:59.791Z"},"maintainers":[{"name":"busyhe","email":"525118368@qq.com"}],"description":"Ynn plugin for MySQL","homepage":"https://github.com/ynnjs/ynn-plugin-mysql#readme","keywords":["ynn","plugin","database","mysql","db"],"repository":{"type":"git","url":"git+ssh://git@github.com/busyhe-ynn-plugins/plugin-mysql.git"},"author":{"name":"LvChengbin","email":"lvchengbin59@gmail.com"},"bugs":{"url":"https://github.com/ynnjs/ynn-plugin-mysql/issues"},"readme":"# @busyhe/ynn-plugin-mysql\n\nYnn的MySQL连接管理插件\n\n## Installation\n\n```sh\n$ npm install --save @busyhe/ynn-plugin-mysql\n```\n\n## Usage\n\n```js\nconst Ynn = require( 'ynn' );\nconst app = new Ynn( {\n    root : __dirname,\n    debugging : Ynn.DEBUGGING_DANGER,\n    logging : false,\n    plugins : {\n        // app.db\n        db : {\n            path : '@busyhe/ynn-plugin-mysql',\n            options : {\n                config : {\n                    host : 'localhost',\n                    user : 'root',\n                    port : 3306,\n                    password : '',\n                    supportBigNumbers : true,\n                    bigNumberStrings : true\n                }\n            }\n        },\n        // 创建另外一个mysql链接，使用 app.anotherDB 获取\n        anotherDB : {\n            path : '@busyhe/ynn-plugin-mysql',\n            options : {\n                // ...\n            }\n        }\n    }\n} );\n```\n\n### 注意事项\n\n`@busyhe/ynn-plugin-mysql` 插件在每次请求中被调用时创建MySQL链接，请求结束后关闭对应链接。如果需要创建一个逻辑独立的链接，可使用 `app.db.connection.promise()`。 __详细配置项请参考[mysql2](https://github.com/sidorares/node-mysql2#readme)文档__\n","readmeFilename":"README.md"}