fix copy format case

This commit is contained in:
Simon Martín 2018-06-04 18:15:28 +02:00
parent a844b5d31d
commit 2f2dcfd762
2 changed files with 2 additions and 1 deletions

View File

@ -10,7 +10,7 @@ module.exports = {
return false;
}
if(copyQuery.includes(' WITH ') && copyQuery.includes('FORMAT ')) {
if(copyQuery.includes(' WITH') && copyQuery.includes('FORMAT ')) {
const regex = /\bFORMAT\s+(\w+)/;
const result = regex.exec(copyQuery);

View File

@ -9,6 +9,7 @@ describe('query info', function () {
"COPY copy_endpoints_test (id, name) FROM STDIN WITH (FORMAT CSV, DELIMITER ',', HEADER true)",
"COPY copy_endpoints_test (id, name) FROM STDIN WITH (FORMAT CSV , DELIMITER ',', HEADER true)",
"COPY copy_endpoints_test (id, name) FROM STDIN WITH (FORMAT CSV)",
"COPY copy_endpoints_test FROM STDIN WITH(FORMAT csv,HEADER true)"
];
validQueries.forEach(query => {