Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var i = 0;
- exports.handler = function (event, context) {
- context.succeed(++i);
- };
- > 0
- > 1
- > 2
- > 0
- > 1
- > 0
- > 3
- > 2
- > 4
- > 1
- > 2
- var MySQL = require('mysql');
- var pool = MySQL.createPool({
- connectionLimit: 10,
- host: '*****',
- user: '*****',
- pass: '*****',
- database: '*****'
- });
- function logError (err, callback) {
- console.error(err);
- callback('Unable to perform operation');
- }
- exports.handler = function (event, context) {
- connectionPool.getConnection(function (err, connection) {
- err && logError(err, context.fail);
- connection.query('CALL someSP(?)', [event.user_id], function (err, data) {
- err && logError(err, context.fail);
- context.succeed(data[0]);
- connection.release();
- });
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement