Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pg-minify

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pg-minify

Minifies PostgreSQL scripts.

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
368K
decreased by-0.76%
Maintainers
1
Weekly downloads
 
Created

What is pg-minify?

pg-minify is an npm package designed to minify SQL queries. It removes unnecessary whitespace, comments, and other non-essential elements from SQL code, making it more compact and potentially improving performance when sending queries to a PostgreSQL database.

What are pg-minify's main functionalities?

Minify SQL Queries

This feature allows you to minify a given SQL query by removing unnecessary whitespace and comments. The example demonstrates how to use pg-minify to minify a simple SQL query.

const pgMinify = require('pg-minify');
const sql = 'SELECT * FROM users WHERE id = $1; -- Get user by ID';
const minifiedSQL = pgMinify(sql);
console.log(minifiedSQL); // Outputs: 'SELECT * FROM users WHERE id=$1;'

Error Handling

pg-minify provides error handling capabilities to catch and handle any issues that arise during the minification process. The example shows how to wrap the minification process in a try-catch block to handle potential errors.

const pgMinify = require('pg-minify');
try {
  const sql = 'SELECT * FROM users WHERE id = $1; -- Get user by ID';
  const minifiedSQL = pgMinify(sql);
  console.log(minifiedSQL);
} catch (error) {
  console.error('Error minifying SQL:', error);
}

Other packages similar to pg-minify

Keywords

FAQs

Package last updated on 30 Jan 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc