Socket
Socket
Sign inDemoInstall

@sqltools/formatter

Package Overview
Dependencies
1
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @sqltools/formatter

Formats SQL queries. Part of SQLTools


Version published
Maintainers
1
Install size
1.44 MB
Created

Package description

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

Readme

Source

SQLTools Formatter

Build Status codecov NPM version GitHub

Forked from zeroturnaround/sql-formatter

This package is part of vscode-sqltools extension.

Keywords

FAQs

Last updated on 12 May 2020

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc