bravo-formatter
Advanced tools
Comparing version 1.0.9 to 1.0.10
@@ -11,3 +11,3 @@ /** | ||
// find CREATE rows with trailing comma, if no comma (only one row) - no-op | ||
if (lines[i].match(/^\s*CREATE\s*TABLE.+\(/i)) { | ||
if (lines[i].match(/^\s*CREATE\s*(EXTERNAL\s+)?TABLE.+\(/i)) { | ||
let aliasLines = []; | ||
@@ -14,0 +14,0 @@ newQuery.push(lines[i]); // add create table line to new query |
@@ -14,3 +14,3 @@ import { expandPhrases } from '../../expandPhrases.js'; | ||
// Data definition | ||
'CREATE [RECURSIVE] VIEW', 'CREATE [GLOBAL TEMPORARY | LOCAL TEMPORARY] TABLE']); | ||
'CREATE [RECURSIVE] VIEW', 'CREATE [GLOBAL TEMPORARY | LOCAL TEMPORARY | EXTERNAL] TABLE']); | ||
const onelineClauses = expandPhrases([ | ||
@@ -17,0 +17,0 @@ // - update: |
@@ -75,3 +75,4 @@ /** | ||
const nextToken = nextNonCommentToken(tokens, i); | ||
if (nextToken && isOpenParen(nextToken)) { | ||
const prevToken = prevNonCommentToken(tokens, i); | ||
if (nextToken && isOpenParen(nextToken) && (prevToken === null || prevToken === void 0 ? void 0 : prevToken.text) !== '.') { | ||
return { | ||
@@ -78,0 +79,0 @@ ...token, |
@@ -27,3 +27,5 @@ import nearley from 'nearley'; | ||
} = parser.feed(sql); | ||
console.log(results); | ||
// console.log(results); | ||
if (results.length === 1) { | ||
@@ -30,0 +32,0 @@ return results[0]; |
{ | ||
"name": "bravo-formatter", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"description": "Format whitespace in a SQL query to make it more readable", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2379243
9752