JSPM

pg-query-emscripten

5.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 135149
  • Score
    100M100P100Q176615F
  • License MIT

Parse any valid PostgreSQL query in your browser using Javascript!

Package Exports

  • pg-query-emscripten
  • pg-query-emscripten/pg_query.js

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

Parse any valid PostgreSQL query in your browser using Javascript!

This builds a pure Javascript port of libpg_query using emscripten, that allows you to parse SQL in the browser into the PostgreSQL parse tree.

Example use cases might include automatically checking for bad query patterns (e.g. LIMIT/OFFSET), understanding which tables a query references, or using structural pg_dump output to produce a schema diagram on the fly.

Usage

npm install pg-query-emscripten --save
import Module from "pg-query-emscripten";

let pgQuery;

(async () => {
  pgQuery = await new Module();

  console.log(pgQuery.parse("select 1"));
})();

Author

LICENSE

Copyright (c) 2018 Lukas Fittl
Licensed under the MIT License.