
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
mysql-format
Advanced tools
Simplified MySQL Promises Package Coded In TypeScript
npm
npm i mysql-format
Type | Usage |
---|---|
arrayResults | getAll() |
arrayResults | getByFiled({...FilterFiled}) |
jsonResults | getOneByFiled({...FilterFiled}) |
boolResults | createOne({...NewField},customQuery?, ...args) |
boolResults | updateOne({...FilterFiled}, {...NewFiled}, customQuery?, ...args) |
boolResults | deleteOne({...FilterFiled}) |
boolResults | deleteAll() |
evalResults | evalAsync("SQL QUERY", ...args) |
callback | eval("SQL QUERY", (err, data)=> void, ...args) |
import { Connection } from "mysql-format";
let connection = new Connection(
{
port: 3308,
user: "username",
password: "password",
host: "localhost",
database: "database",
},
{
printErrors: false,
throwErrors: true,
}
);
async function Test() {
let results = await db.evalAsync("SELECT * FROM quizServers");
let parsed = JSON.parse(results.results[0].connections);
const newJson: any[] = [];
for (const i in parsed) {
let data = parsed[i];
if (!newJson.find((e) => e.id == data.id)) {
newJson.push(data);
}
}
newJson.push({
id: 555,
position: 8,
});
let data = await db.evalAsync(
`UPDATE quizServers SET connections=? WHERE id="25"`,
JSON.stringify(newJson.sort((a, b) => a.position - b.position))
);
console.log(data.results);
}
async function Test() {
const model = db.useModel("accounts");
let results = await model.getAll();
console.log(results.results); // any[]
}
FAQs
Simplified MySQL Promises Package Coded In TypeScript
The npm package mysql-format receives a total of 0 weekly downloads. As such, mysql-format popularity was classified as not popular.
We found that mysql-format 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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.