
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
一个轻量、简单的 SQL 生成器
npm install babysql
const { BabySQL } = require("babysql");
const q = BabySQL.select('users')
.columns(['id', 'name'])
.where('status', '=', 'active')
.orderBy('id', 'DESC')
.limit(20)
.debug()
.build();
const { BabySQL } = require("babysql");
const q = BabySQL.select('users')
.whereLike('name', 'alice') // name LIKE '%alice%'
.build();
const { BabySQL } = require("babysql");
const q = BabySQL.count('users')
.countColumn('id', 'userCount')
.build();
const { BabySQL } = require("babysql");
const q = BabySQL.select('posts')
.paginate(3, 10) // 第3页,每页10条
.build();
const { BabySQL } = require("babysql");
const q = BabySQL.insert('users')
.data({ name: 'Alice', age: 25, created_at: new Date() })
.build();
const { BabySQL } = require("babysql");
// 安全更新(必须带 WHERE)
const q = BabySQL.update('users')
.data({ age: 26 })
.where('id', '=', 1)
.build();
// 全表更新(危险操作,需显式允许)
const q = BabySQL.update('users')
.data({ status: 'inactive' })
.allowUnsafe()
.build();
const { BabySQL } = require("babysql");
// 安全删除
const q = BabySQL.delete('users')
.where('id', '=', 1)
.build();
// 全表删除(危险操作)
const q = BabySQL.delete('users')
.allowUnsafe()
.build();
const { BabySQL } = require("babysql");
const q = BabySQL.select('products')
.whereLike('name', 'book') // 模糊查询 %book%
.whereIn('category_id', [1, 2, 3])
.build();
const { BabySQL } = require("babysql");
const q = BabySQL.select('logs')
.whereRaw('created_at > ?', ['2024-01-01'])
.build();
{
sql: string, // 最终 SQL
params: any[] // 参数数组
}
FAQs
轻量的 SQL 生成器,支持 CommonJS 与 TS 使用。
We found that babysql demonstrated a healthy version release cadence and project activity because the last version was released less than 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.