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

@sqltools/formatter

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sqltools/formatter

Formats SQL queries. Part of SQLTools

  • 1.2.5
  • beta
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.8M
decreased by-12.93%
Maintainers
2
Weekly downloads
 
Created

What is @sqltools/formatter?

The @sqltools/formatter package is a library for formatting SQL queries. It provides a way to beautify SQL code, making it more readable and maintainable. It supports various SQL dialects and allows customization of the formatting options.

What are @sqltools/formatter's main functionalities?

SQL Formatting

This feature allows you to format SQL queries. The code sample demonstrates how to format a simple SQL SELECT query using the package.

const { format } = require('@sqltools/formatter');
const query = 'SELECT * FROM table WHERE id = 1';
const formattedQuery = format(query, { language: 'sql' });
console.log(formattedQuery);

Customizing Formatting Options

This feature allows you to customize the formatting options such as indentation, case, and line breaks. The code sample shows how to format a query with custom options for indentation and uppercase keywords.

const { format } = require('@sqltools/formatter');
const options = {
  language: 'sql',
  indent: '    ',
  uppercase: true
};
const query = 'select * from table where id = 1';
const formattedQuery = format(query, options);
console.log(formattedQuery);

Other packages similar to @sqltools/formatter

Keywords

FAQs

Package last updated on 16 Oct 2022

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