
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
A simple SQL parameterized query generator for most SQL language
npm install sqlbind.js
const {sql_bind, sql_val} = require(sqlbind);
const tb_name = "post";
const title = "hello";
const body = "hello world";
const sql = sql_bind`insert into ${tb_name}(title, body) values(${sql_val(title)}, ${sql_val(body)})`
console.log(sql)
/* output
{
str: sql_bind`insert into post(title, body) values(?, ?);`,
bindings: ["hello", "hello world"],
...
}
*/
// then you can use it with other database libary
const knex = requrie("knex")({client: 'pg'});
knex.raw(sql.str, sql.bindings)
// other dialect
console.log(sql.pg)
/* output
{
str: sql_bind`insert into post(title, body) values($0, $1);`,
bindings: ["hello", "hello world"]
}
*/
console.log(sql.mysql)
/* output
{
str: sql_bind`insert into post(title, body) values(?c0, ?c1);`,
bindings: {
"c0": "hello",
"c1": "hello world"
}
}
console.log(sql.mssql)
/* output
{
str: sql_bind`insert into post(title, body) values(@c0, @c1);`,
bindings: {
"c0": "hello",
"c1": "hello world"
}
}
console.log(sql.sqlite)
/* output
{
str: sql_bind`insert into post(title, body) values($c0, $c1);`,
bindings: {
"c0": "hello",
"c1": "hello world"
}
}
*/
function sql_bind(expressions: any[])=>SqlBind
sql_bind`string text ${expression} string text`=>SqlBind
alias sb, generate sql statement with parameters
function sql_value(value: any)=\>SqlValue
alias sv, stored the value that will parameterized
function is_sql(arg: any)=>boolean
true if it is SqlBind or SqlBind
[ ] add custom validate
[ ] support more dialect
FAQs
Simple SQL parameterize query generator
The npm package sqlbind receives a total of 0 weekly downloads. As such, sqlbind popularity was classified as not popular.
We found that sqlbind 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
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.