
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
A powerful, type-safe SQL query builder for Node.js with support for MySQL, PostgreSQL, and SQLite. Features fluent API, transaction management, and connection pooling.
A powerful, type-safe SQL query builder primarily designed for TypeScript, with support for MySQL, PostgreSQL, and SQLite.
npm install queryforge
QueryForge is primarily designed for TypeScript, but you can use it in JavaScript projects in two ways:
const { QueryForge } = require('queryforge');
const qf = new QueryForge({
type: 'mysql',
host: 'localhost',
port: 3306,
username: 'root',
password: '',
database: 'test_db'
});
// Use normally
async function example() {
await qf.connect();
const users = await qf
.table('users')
.select('*')
.execute();
}
// @ts-check
const { QueryForge } = require('queryforge');
/** @type {import('queryforge').DatabaseConfig} */
const config = {
type: 'mysql',
host: 'localhost',
port: 3306,
username: 'root',
password: '',
database: 'test_db'
};
// Now you get TypeScript type checking in JS
import { QueryForge } from 'queryforge';
// Database configuration
const config = {
type: 'mysql', // or 'postgres', 'sqlite'
host: 'localhost',
port: 3306,
username: 'root',
password: '',
database: 'test_db'
};
// Create QueryForge instance
const qf = new QueryForge(config, { logging: true });
// Basic Usage Examples
async function examples() {
// Connect to database
await qf.connect();
try {
// SELECT example
const users = await qf
.table('users')
.select('id', 'name', 'email')
.where('age', '>', 18)
.orderBy('name', 'ASC')
.limit(10)
.execute();
// INSERT example
const newUser = await qf
.table('users')
.insert({
name: 'John Doe',
email: 'john@example.com',
age: 25
})
.execute();
// UPDATE example
await qf
.table('users')
.update({ status: 'active' })
.where('id', '=', 1)
.execute();
// DELETE example
await qf
.table('users')
.delete()
.where('status', '=', 'inactive')
.execute();
// Transaction example
await qf.beginTransaction();
try {
await qf
.table('orders')
.insert({
user_id: 1,
total: 100
})
.execute();
await qf
.table('users')
.update({ order_count: qf.raw('order_count + 1') })
.where('id', '=', 1)
.execute();
await qf.commit();
} catch (error) {
await qf.rollback();
throw error;
}
} catch (error) {
console.error('Error:', error);
} finally {
await qf.disconnect();
}
}
const result = await qf
.table('users as u')
.select('u.id', 'u.name', 'o.total as order_total')
.join('orders as o', 'u.id', '=', 'o.user_id')
.where('u.status', '=', 'active')
.andWhere('o.created_at', '>', '2024-01-01')
.groupBy('u.id')
.having('COUNT(o.id)', '>', 5)
.orderBy('u.name', 'ASC')
.limit(10)
.offset(0)
.execute();
const users = [
{ name: 'Alice', email: 'alice@example.com' },
{ name: 'Bob', email: 'bob@example.com' }
];
await qf
.table('users')
.insertMany(users)
.execute();
git checkout -b feature/amazing-feature
)git commit -m 'feat: Add amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
A powerful, type-safe SQL query builder for Node.js with support for MySQL, PostgreSQL, and SQLite. Features fluent API, transaction management, and connection pooling.
We found that queryforge demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.