How to use the pg-query-native.parse function in pg-query-native

To help you get started, we’ve selected a few pg-query-native examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zhm / pg-query-parser / src / index.js View on Github external
const verify = (query) => {
  const result = deparse(parse(query).query);

  const json1 = clean(parse(query).query);
  const json2 = clean(parse(result).query);

  return JSON.stringify(json1) === JSON.stringify(json2);
};
github zhm / pg-query-parser / src / index.js View on Github external
const verify = (query) => {
  const result = deparse(parse(query).query);

  const json1 = clean(parse(query).query);
  const json2 = clean(parse(result).query);

  return JSON.stringify(json1) === JSON.stringify(json2);
};
github benjie / prettier-plugin-pg / src / index.js View on Github external
function parse(text, _parsers, _options) {
  const { query, error, stderr } = parseSQL(text);
  if (error) {
    throw error;
  }
  if (stderr.length) {
    throw new Error("Error occurred: " + stderr);
  }
  return query;
}

pg-query-native

The real PostgreSQL query parser

BSD-3-Clause
Latest version published 3 years ago

Package Health Score

36 / 100
Full package analysis

Popular pg-query-native functions