Skip to content

Commit

Permalink
FE: fix missing selectStatement property during RE (#107)
Browse files Browse the repository at this point in the history
* FE: fix missing selectStatement property during RE

* FE: fix incorrect new line position for semicolon after select statement
  • Loading branch information
mtseluiko authored Dec 21, 2023
1 parent eb2aa15 commit 2dafc66
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion forward_engineering/configs/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = {
createView:
'CREATE${secure}${materialized} VIEW IF NOT EXISTS ${name} (\n' +
'\t${column_list}\n' +
')\n${copy_grants}${comment}AS ${select_statement}',
')\n${copy_grants}${comment}AS ${select_statement};\n',
createUDF:
"CREATE${orReplace} FUNCTION ${name}(${arguments})\n\tRETURNS ${returnType}${notNull}\n\tLANGUAGE ${language}${parameters}${comment}\n\tAS ${body};\n",
createProcedure:
Expand Down
2 changes: 1 addition & 1 deletion forward_engineering/ddlProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ module.exports = (baseProvider, options, app) => {

const selectStatement =
viewData.selectStatement ||
`SELECT \n\t${viewColumnsToString(tableColumns, isActivated)}\nFROM ${tables.join(' INNER JOIN ')};\n`;
`SELECT \n\t${viewColumnsToString(tableColumns, isActivated)}\nFROM ${tables.join(' INNER JOIN ')}`;

return assignTemplates(templates.createView, {
secure: viewData.secure ? ' SECURE' : '',
Expand Down
3 changes: 2 additions & 1 deletion reverse_engineering/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ const getDbCollectionsData = async (data, logger, cb, app) => {
data: viewData,
ddl: {
script: ddl,
type: 'snowflake'
type: 'snowflake',
takeAllDdlProperties: true,
}
};
}));
Expand Down

0 comments on commit 2dafc66

Please sign in to comment.