@benjie/pg-query-native

2.0.0 • Public • Published

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);

Related

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.0
    2

Package Sidebar

Install

npm i @benjie/pg-query-native

Weekly Downloads

2

Version

2.0.0

License

BSD

Last publish

Collaborators

  • benjie