0.0.1 • Published 10 months ago

nodejs-mysql-params-order v0.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

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.