nodejs-mysql-params-order

0.0.1 • Public • Published

This is a NodeJS module that ensures the order of the parameters according to the query with annotated parameters name.

Installation

npm install nodejs-mysql-params-order

Usage

import ensureOrderFromObject from 'nodejs-mysql-params-order';

const sqlText = 'id = @id and name = @name';
const objectParams = { id: 1, name: 'Eduardo' };

const correctOrderParams = ensureOrderFromObject(sqlText, objectParams);

console.log(correctOrderParams); // [1, 'Eduardo']

License

This project is licensed under the ISC License.

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i nodejs-mysql-params-order

      Weekly Downloads

      0

      Version

      0.0.1

      License

      ISC

      Unpacked Size

      4.73 kB

      Total Files

      5

      Last publish

      Collaborators

      • eduardo.petrini