JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 819
  • Score
    100M100P100Q106580F
  • License BSD

The real PostgreSQL query parser

Package Exports

  • pg-query-native

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 (pg-query-native) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

pg-query-native Build Status

The real PostgreSQL parser for nodejs.

This is based on the output of libpg_query. This wraps the static library output and links it into a node module for use in js.

All credit for the hard problems goes to Lukas Fittl.

Installation

npm install pg-query-native

Documentation

query.parse(query)

Parses the query and returns the parse tree.

Parameters

parameter type description
query String SQL query

Returns an object in the format:

{ query: <query|Object>,
  error: { message: <message|String>,
           fileName: <fileName|String>,
           lineNumber: <line|Number>,
           cursorPosition: <cursor|Number> }

Example

var parse = require('pg-query-native').parse;

console.log(parse('select 1').query);