Socket
Book a DemoInstallSign in
Socket

@creativecuriosityau/sql-placeholders

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@creativecuriosityau/sql-placeholders

SQL named placeholders to unnamed compiler

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
22
37.5%
Maintainers
1
Weekly downloads
 
Created
Source

NPM

CI

named-placeholders

compiles "select foo where foo.id = :bar and foo.baz < :baz" into "select foo where foo.id = ? and foo.baz < ?" + ["bar", "baz"]

usage

npm install named-placeholders

see this mysql2 discussion

var mysql = require('mysql');
var toUnnamed = require('named-placeholders')();

var q = toUnnamed('select 1+:test', { test: 123});
mysql.createConnection().query(q[0], q[1]);

credits

parser is based on @mscdex code of his excellent node-mariasql library

FAQs

Package last updated on 14 Mar 2024

Did you know?

Socket

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.

Install

Related posts