mysqlprocedures

1.11.0 • Public • Published

StoredProcedureCaller

A simple Node.js module for calling stored procedures using MySQL.

Installation

Install the package using npm:

npm install mysqlprocedures



#Usage

const StoredProcedureCaller = require('mysqlprocedures');

// Set up MySQL connection configuration
const dbConfig = {
  host: 'your-host',
  user: 'your-username',
  password: 'your-password',
  database: 'your-database',
};

// Create an instance of StoredProcedureCaller
const storedProcedureCaller = new StoredProcedureCaller(dbConfig);

// Define the stored procedure name and input parameters
const procedureName = 'your_stored_procedure';
const inputs = [param1, param2, param3]; // replace with your actual parameters

// Call the stored procedure
storedProcedureCaller.callStoredProcedure(procedureName, inputs, (error, results) => {
  if (error) {
    console.error('Error:', error);
  } else {
    console.log('Results:', results);
  }

  // Close the MySQL connection
  storedProcedureCaller.closeConnection();
});

Dependents (0)

Package Sidebar

Install

npm i mysqlprocedures

Weekly Downloads

13

Version

1.11.0

License

MIT

Unpacked Size

2.82 kB

Total Files

4

Last publish

Collaborators

  • divyesh_