Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
any-db-params
Advanced tools
Collect parameters and create placeholders for SQL queries for any database supported by any-db
.
createParams = require('any-db-params');
// Fake a queryable object (connection/transaction/pool etc)
var queryable = {
adapter: { name: 'mssql' }
query: function (sql, params) {
console.log(sql, params);
}
};
var param = createParams(queryable);
var sql = 'select * from people ' +
'where age > ' + param('age', 30) +
' and weight > ' + param('weight', 70);
queryable.query(sql, param.values());
//=> 'select * from people where age > @age and weight > @weight' { age: 30, weight: 70 }
module.exports =: (Queryable) => ParamAccessor
ParamAccessor = ( (name: String, value?: Any) => String ) & {
values: () => Object|Array
}
Given a Queryable
, returns a ParamAccessor
. A ParamAccessor
is a function that accepts 1 or 2 arguments. With 2 arguments it sets a named parameter value and returns a placeholder, with 1 argument it returns the placeholder for a previously defined parameter.
A ParamAccessor
also has a values
method, which will return a shallow copy of it's internal value storage, suitable for passing as the second parameter to queryable.query
.
MIT
FAQs
Collect parameters and generate SQL placeholders for any database
The npm package any-db-params receives a total of 3 weekly downloads. As such, any-db-params popularity was classified as not popular.
We found that any-db-params demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.