pgsql-deparser
Advanced tools
Comparing version 13.0.5 to 13.1.0
@@ -6,2 +6,10 @@ # Change Log | ||
# [13.1.0](https://github.com/pyramation/pgsql-parser/compare/pgsql-deparser@13.0.5...pgsql-deparser@13.1.0) (2021-03-20) | ||
**Note:** Version bump only for package pgsql-deparser | ||
## [13.0.5](https://github.com/pyramation/pgsql-parser/compare/pgsql-deparser@13.0.4...pgsql-deparser@13.0.5) (2021-03-20) | ||
@@ -8,0 +16,0 @@ |
@@ -14,20 +14,5 @@ "use strict"; | ||
// import { getEnum, nodes, toStr, toInt } from 'pgsql-enums'; | ||
var wrapRaw = function wrapRaw(tree) { | ||
return tree.stmts.map(function (_ref) { | ||
var stmt = _ref.stmt, | ||
stmt_len = _ref.stmt_len; | ||
return { | ||
RawStmt: { | ||
stmt: stmt, | ||
stmt_len: stmt_len | ||
} | ||
}; | ||
}); | ||
}; | ||
// NOTE: this is used to get rid of List.items... and use Arrays | ||
var preparse = function preparse(tree) { | ||
var stmts = wrapRaw(tree); | ||
return stmts.map(function (stmt) { | ||
return transformArrays(stmt); | ||
}); | ||
return transformArrays(tree); | ||
}; // export const transform = (obj, context) => { | ||
@@ -34,0 +19,0 @@ // let copy = null; |
/* eslint-disable no-restricted-syntax */ | ||
// import { getEnum, nodes, toStr, toInt } from 'pgsql-enums'; | ||
const wrapRaw = tree => { | ||
return tree.stmts.map(({ | ||
stmt, | ||
stmt_len | ||
}) => { | ||
return { | ||
RawStmt: { | ||
stmt, | ||
stmt_len | ||
} | ||
}; | ||
}); | ||
}; | ||
export const preparse = tree => { | ||
const stmts = wrapRaw(tree); | ||
return stmts.map(stmt => transformArrays(stmt)); | ||
}; // export const transform = (obj, context) => { | ||
// NOTE: this is used to get rid of List.items... and use Arrays | ||
export const preparse = tree => transformArrays(tree); // export const transform = (obj, context) => { | ||
// let copy = null; | ||
@@ -22,0 +6,0 @@ // // Handle null or undefined |
{ | ||
"name": "pgsql-deparser", | ||
"version": "13.0.5", | ||
"version": "13.1.0", | ||
"description": "PostgreSQL AST Deparser", | ||
@@ -68,3 +68,3 @@ "author": "Dan Lynch <pyramation@gmail.com>", | ||
"jest": "^25.1.0", | ||
"pgsql-parser": "^13.0.5", | ||
"pgsql-parser": "^13.1.0", | ||
"prettier": "^2.1.2", | ||
@@ -77,5 +77,5 @@ "regenerator-runtime": "^0.13.2" | ||
"lodash": "4.17.20", | ||
"pgsql-enums": "^13.0.3" | ||
"pgsql-enums": "^13.1.0" | ||
}, | ||
"gitHead": "3cf6869d4ee7edb777e1d6a3d42d37d2b0999cc4" | ||
"gitHead": "63f2e1051407eedb479a83676056ba1ede406e7d" | ||
} |
@@ -20,7 +20,7 @@ # pgsql-parser [](https://travis-ci.org/pyramation/pgsql-parser) | ||
const { stmts } = parse('SELECT * FROM test_table'); | ||
const stmts = parse('SELECT * FROM test_table'); | ||
stmts[0].stmt.SelectStmt.fromClause[0].RangeVar.relname = 'another_table'; | ||
stmts[0].RawStmt.stmt.SelectStmt.fromClause[0].RangeVar.relname = 'another_table'; | ||
console.log(deparse({stmts})); | ||
console.log(deparse(stmts)); | ||
@@ -38,7 +38,7 @@ // SELECT * FROM "another_table" | ||
const { stmts } = parse('SELECT * FROM test_table'); | ||
const stmts = parse('SELECT * FROM test_table'); | ||
stmts[0].stmt.SelectStmt.fromClause[0].RangeVar.relname = 'another_table'; | ||
stmts[0].RawStmt.stmt.SelectStmt.fromClause[0].RangeVar.relname = 'another_table'; | ||
console.log(deparse({stmts})); | ||
console.log(deparse(stmts)); | ||
@@ -45,0 +45,0 @@ // SELECT * FROM "another_table" |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
239424
6419
Updatedpgsql-enums@^13.1.0