
Research
GemStuffer Campaign Abuses RubyGems as Exfiltration Channel Targeting UK Local Government
GemStuffer abuses RubyGems as an exfiltration channel, packaging scraped UK council portal data into junk gems published from new accounts.
A universal SQL query builder for Node.js, Bun, and Deno with TypeScript support.
High-performance TypeScript SQL builder for MySQL / MariaDB. Supports dynamic queries, inserts, updates, deletes, complex filtering, aggregates, joins, sorting, pagination, and safe SQL utilities. Works in Node.js, Deno, and Bun.
# Node.js / Bun
npm install @tezx/sqlx
# Deno
import { insert, find, update, destroy, condition, escape, format } from "https://esm.sh/@tezx/sqlx/mysql";
import { insert } from "@tezx/sqlx/mysql";
// Insert a single row
const singleRow = insert<["name","email","created_at"]>(
"users",
{ name: "Rakibul Islam", email: "rakib@example.com", created_at: "CURRENT_TIMESTAMP" }
);
// Insert multiple rows
const multipleRows = insert<["name","email","created_at"]>(
"users",
[
{ name: "Alice", email: "alice@example.com", created_at: "CURRENT_TIMESTAMP" },
{ name: "Bob", email: "bob@example.com", created_at: "CURRENT_TIMESTAMP" },
]
);
// Insert with INSERT IGNORE
const insertIgnore = insert<["email","name"]>(
"users",
{ email: "alice@example.com", name: "Alice Updated" },
{ uniqueColumn: "email" }
);
// Insert with ON DUPLICATE KEY UPDATE
const insertDuplicate = insert<["email","name"]>(
"users",
{ email: "bob@example.com", name: "Bob Updated" },
{ onDuplicateUpdateFields: ["name"] }
);
import { condition } from "@tezx/sqlx/mysql";
const filters = {
status: "active",
age: { gte: 18, lte: 65 },
country: { in: ["US","CA"] },
$or: { title: { like: "%manager%" }, department: { eq: "HR" } },
last_login: { isNull: true }
};
const whereClause = condition(filters);
destroy)import { destroy } from "@tezx/sqlx/mysql";
// Simple delete
const simpleDelete = destroy("posts", { where: "user_id = 5" });
// Delete with join
const deleteJoin = destroy("posts", {
where: "users.status = 'inactive' AND posts.user_id = users.id",
joins: [{ type: "INNER JOIN", table: "users", on: "posts.user_id = users.id" }],
});
// Delete with sort and limit
const deleteLimit = destroy("posts", { where: "user_id = 5", sort: { column: "created_at", order: "ASC" }, limit: 10 });
update)import { update } from "@tezx/sqlx/mysql";
// Simple update
const simpleUpdate = update("users", { values: { status: "active", points: 100 }, where: "id = 5" });
// Update with CASE expression
const caseUpdate = update("users", {
values: {
status: { case: [{ when: "points > 1000", then: "gold" }, { when: "points > 500", then: "silver" }], default: "bronze" },
last_login: null
},
where: "status != 'inactive'",
});
// Update with JOIN, sort, limit
const updateJoin = update("users", {
values: { status: "inactive" },
joins: [{ type: "INNER JOIN", table: "orders", on: "users.id = orders.user_id" }],
where: "orders.created_at < '2024-01-01'",
sort: { column: "users.last_login", order: "ASC" },
limit: 10,
});
// Update default values and calculations
const updateDefaults = update("users", {
defaultValues: ["points"],
setCalculations: { last_login: "NOW()" },
where: "id IN (1,2,3)",
});
find)import { find } from "@tezx/sqlx/mysql";
const selectQuery = find<["users","orders"]>("users", {
distinct: true,
columns: { users: ["id","name","age","city"], orders: ["status"] },
aggregates: [{ SUM: "orders.total", alias: "totalSpent" }, { COUNT: "orders.id", alias: "orderCount" }],
joins: [{ type: "LEFT JOIN", table: "orders", on: "users.id = orders.user_id" }],
where: "users.age > 18",
groupBy: { users: ["id","name","age","city"] },
sort: { column: "totalSpent", order: "DESC" },
limitSkip: { limit: 10, skip: 0 },
});
import { mysql_datetime, mysql_date } from "@tezx/sqlx/mysql";
mysql_datetime(); // current datetime "YYYY-MM-DD HH:mm:ss"
mysql_date("1990-05-23"); // "1990-05-23"
mysql_datetime(new Date("2023-01-15T10:20:30Z")); // "2023-01-15 10:20:30"
import { escape, format, sanitize, parseMySQLUrl } from "@tezx/sqlx/mysql";
escape("O'Reilly"); // 'O\'Reilly'
format("SELECT * FROM users WHERE name=? AND age>?", ["Alice", 30]);
sanitize("some input"); // alias for escape
parseMySQLUrl("mysql://user:pass@localhost:3306/mydb?charset=utf8mb4");
insert, update, destroy, find, conditionescape, sanitize, formatmysql_date, mysql_datetimeparseMySQLUrlFAQs
A universal SQL query builder for Node.js, Bun, and Deno with TypeScript support.
We found that @tezx/sqlx 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.

Research
GemStuffer abuses RubyGems as an exfiltration channel, packaging scraped UK council portal data into junk gems published from new accounts.

Company News
Socket was named to the Rising in Cyber 2026 list, recognizing 30 private cybersecurity startups selected by CISOs and security executives.

Research
Socket detected 84 compromised TanStack npm package artifacts modified with suspected CI credential-stealing malware.