JSPM

sqlformatter

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 123
  • Score
    100M100P100Q77262F
  • License LGPL-2.1

Performs formatting of basic SQL statements (DML + query).

Package Exports

  • sqlformatter

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sqlformatter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Performs formatting of basic SQL statements (DML + query).

Direct conversion in javascript of this hibernate java code from http://grepcode.com/file/repo1.maven.org/maven2/org.hibernate/hibernate-core/4.3.6.Final/org/hibernate/engine/jdbc/internal/BasicFormatterImpl.java#BasicFormatterImpl

Installation

$ npm install sqlformatter

###Examples

var sqlformatter = require('sqlformatter')
var sql = "select * from dual";

console.log(sqlformatter.format(sql));

Output:

 select
     *
 from
     dual

###Tests

To run the test suite, first install the dependancies, then run npm test:

$ npm install
$ npm test