Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions forward_engineering/ddlProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module.exports = (baseProvider, options, app) => {
const additionalOptions = getAdditionalOptions(options.additionalOptions);

return dropStatementProxy({ commentIfDeactivated })(additionalOptions.applyDropStatements, {
hydrateDatabase(containerData) {
hydrateSchema(containerData) {
return {
databaseName: containerData.name,
isActivated: containerData.isActivated,
Expand All @@ -72,6 +72,11 @@ module.exports = (baseProvider, options, app) => {
};
},

// Keep it because it was used to hydrate `dbData` for the API
hydrateDatabase(containerData) {
return this.hydrateSchema(containerData);
},

hydrateTable({ tableData, entityData, jsonSchema }) {
const detailsTab = entityData[0];
const tableIndexes = entityData[2].Indxs;
Expand Down Expand Up @@ -162,7 +167,7 @@ module.exports = (baseProvider, options, app) => {
};
},

createDatabase({
createSchema({
databaseName,
isActivated = true,
db_account,
Expand Down Expand Up @@ -620,7 +625,7 @@ module.exports = (baseProvider, options, app) => {
* @param {Array<HydrateDropContainerData>} containerData
* @return {DropContainerData}
*/
hydrateDropDatabase(containerData) {
hydrateDropSchema(containerData) {
return {
databaseName: containerData[0]?.name || '',
};
Expand All @@ -631,7 +636,7 @@ module.exports = (baseProvider, options, app) => {
* @param {ContainerCompModeData} compModeData
* @return {ModifyContainerData}
*/
hydrateAlterDatabase({ containerData, compModeData }) {
hydrateAlterSchema({ containerData, compModeData }) {
const data = containerData[0] || {};

const isDbAccountModified = compModeData.new.db_account !== compModeData.old.db_account;
Expand Down Expand Up @@ -890,15 +895,15 @@ module.exports = (baseProvider, options, app) => {
* @param {DropContainerData} dropDbData
* @return {string}
*/
dropDatabase(dropDbData) {
dropSchema(dropDbData) {
return assignTemplates(templates.dropDatabase, dropDbData);
},

/**
* @param {ModifyContainerData} alterDbData
* @return {string}
*/
alterDatabase(alterDbData) {
alterSchema(alterDbData) {
const databaseOptions = getDatabaseOptions(alterDbData);

return assignTemplates(templates.modifyDatabase, {
Expand Down Expand Up @@ -1120,5 +1125,13 @@ module.exports = (baseProvider, options, app) => {
this.createView(alterData, dbData, true),
].join('\n\n');
},

commentStatement(statement) {
return commentIfDeactivated(statement, { isActivated: false });
},

prepareName(name) {
return getTableName(name);
},
});
};
2 changes: 1 addition & 1 deletion forward_engineering/helpers/dropStatementProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const dropStatementProxy =

return {
...ddlProvider,
...['dropDatabase', 'dropTable', 'dropColumn', 'dropIndex', 'dropCheckConstraint', 'dropView'].reduce(
...['dropSchema', 'dropTable', 'dropColumn', 'dropIndex', 'dropCheckConstraint', 'dropView'].reduce(
(result, method) => {
return {
...result,
Expand Down
7 changes: 6 additions & 1 deletion localization/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,5 +174,10 @@
"MODAL_WINDOW___OPTIONS_DISPLAY_ERD_V_ENTITY_BOX_CONTENT": "Display of table box content",
"MODAL_WINDOW___OPTIONS_DISPLAY_ERD_V_FIELDS": "Columns",
"MODAL_WINDOW___OPTIONS_DISPLAY_REQUIRED_ATTRIBUTES": "Required columns",
"MODAL_WINDOW___OPTIONS_DISPLAY_NULLABLE_ATTRIBUTES": "Nullable columns"
"MODAL_WINDOW___OPTIONS_DISPLAY_NULLABLE_ATTRIBUTES": "Nullable columns",

"CUSTOM_SCRIPT_CONTAINER_VAR_NAME": "Database name",
"CUSTOM_SCRIPT_CONTAINER_VAR": "databaseName",
"CUSTOM_SCRIPT_ENTITY_VAR_NAME": "Table name",
"CUSTOM_SCRIPT_ENTITY_VAR": "tableName"
}
134 changes: 128 additions & 6 deletions properties_pane/container_level/containerLevelConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* Copyright © 2016-2019 by IntegrIT S.A. dba Hackolade. All rights reserved.
*
* The copyright to the computer software herein is the property of IntegrIT S.A.
* The software may be used and/or copied only with the written permission of
* IntegrIT S.A. or in accordance with the terms and conditions stipulated in
* the agreement/contract under which the software has been supplied.
* The software may be used and/or copied only with the written permission of
* IntegrIT S.A. or in accordance with the terms and conditions stipulated in
* the agreement/contract under which the software has been supplied.


In order to define custom properties for any object's properties pane, you may copy/paste from the following,
Expand Down Expand Up @@ -71,8 +71,8 @@ making sure that you maintain a proper JSON format.
]
},
// “groupInput” can have the following states - 0 items, 1 item, and many items.
// “blockInput” has only 2 states - 0 items or 1 item.
// This gives us an easy way to represent it as an object and not as an array internally which is beneficial for processing
// “blockInput” has only 2 states - 0 items or 1 item.
// This gives us an easy way to represent it as an object and not as an array internally which is beneficial for processing
// and forward-engineering in particular.
{
"propertyName": "Block",
Expand Down Expand Up @@ -100,7 +100,7 @@ making sure that you maintain a proper JSON format.
"propertyKeyword": "keyList",
"propertyType": "fieldList",
"template": "orderedList"
},
},
{
"propertyName": "List with attribute",
"propertyKeyword": "keyListOrder",
Expand Down Expand Up @@ -179,6 +179,128 @@ making sure that you maintain a proper JSON format.
"propertyType": "text",
"propertyTooltip": "A database can contain only one default journal table. However, any table in a particular database can use a journal table in a different database. By default the journal tebale is created in the new database if none is specified."
},
{
"propertyName": "Custom scripts",
"propertyType": "block",
"propertyKeyword": "customScripts",
"propertyTooltip": "",
"structure": [
{
"propertyName": "Before CREATE DATABASE",
"propertyKeyword": "beforeCreateContainer",
"propertyType": "block",
"propertyTooltip": "",
"structure": [
{
"propertyName": "Script",
"propertyKeyword": "script",
"propertyType": "details",
"markdown": false,
"template": "codeEditor",
"templateOptions": {
"editorDialect": "sql",
"customScriptVariables": true
}
}
]
},
{
"propertyName": "After CREATE DATABASE",
"propertyKeyword": "afterCreateContainer",
"propertyType": "block",
"propertyTooltip": "",
"structure": [
{
"propertyName": "Script",
"propertyKeyword": "script",
"propertyType": "details",
"markdown": false,
"template": "codeEditor",
"templateOptions": {
"editorDialect": "sql",
"customScriptVariables": true
}
}
]
},
{
"propertyName": "Before each CREATE TABLE",
"propertyKeyword": "beforeCreateEntity",
"propertyType": "block",
"propertyTooltip": "",
"structure": [
{
"propertyName": "Script",
"propertyKeyword": "script",
"propertyType": "details",
"markdown": false,
"template": "codeEditor",
"templateOptions": {
"editorDialect": "sql",
"customScriptVariables": true
}
}
]
},
{
"propertyName": "After each CREATE TABLE",
"propertyKeyword": "afterCreateEntity",
"propertyType": "block",
"propertyTooltip": "",
"structure": [
{
"propertyName": "Script",
"propertyKeyword": "script",
"propertyType": "details",
"markdown": false,
"template": "codeEditor",
"templateOptions": {
"editorDialect": "sql",
"customScriptVariables": true
}
}
]
},
{
"propertyName": "Before each CREATE VIEW",
"propertyKeyword": "beforeCreateView",
"propertyType": "block",
"propertyTooltip": "",
"structure": [
{
"propertyName": "Script",
"propertyKeyword": "script",
"propertyType": "details",
"markdown": false,
"template": "codeEditor",
"templateOptions": {
"editorDialect": "sql",
"customScriptVariables": true
}
}
]
},
{
"propertyName": "After each CREATE VIEW",
"propertyKeyword": "afterCreateView",
"propertyType": "block",
"propertyTooltip": "",
"structure": [
{
"propertyName": "Script",
"propertyKeyword": "script",
"propertyType": "details",
"markdown": false,
"template": "codeEditor",
"templateOptions": {
"editorDialect": "sql",
"customScriptVariables": true
}
}
]
}
]
},
{
"propertyName": "Comments",
"propertyKeyword": "description",
Expand Down
58 changes: 52 additions & 6 deletions properties_pane/entity_level/entityLevelConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* Copyright © 2016-2019 by IntegrIT S.A. dba Hackolade. All rights reserved.
*
* The copyright to the computer software herein is the property of IntegrIT S.A.
* The software may be used and/or copied only with the written permission of
* IntegrIT S.A. or in accordance with the terms and conditions stipulated in
* the agreement/contract under which the software has been supplied.
* The software may be used and/or copied only with the written permission of
* IntegrIT S.A. or in accordance with the terms and conditions stipulated in
* the agreement/contract under which the software has been supplied.

In order to define custom properties for any object's properties pane, you may copy/paste from the following,
making sure that you maintain a proper JSON format.
Expand Down Expand Up @@ -70,8 +70,8 @@ making sure that you maintain a proper JSON format.
]
},
// “groupInput” can have the following states - 0 items, 1 item, and many items.
// “blockInput” has only 2 states - 0 items or 1 item.
// This gives us an easy way to represent it as an object and not as an array internally which is beneficial for processing
// “blockInput” has only 2 states - 0 items or 1 item.
// This gives us an easy way to represent it as an object and not as an array internally which is beneficial for processing
// and forward-engineering in particular.
{
"propertyName": "Block",
Expand Down Expand Up @@ -99,7 +99,7 @@ making sure that you maintain a proper JSON format.
"propertyKeyword": "keyList",
"propertyType": "fieldList",
"template": "orderedList"
},
},
{
"propertyName": "List with attribute",
"propertyKeyword": "keyListOrder",
Expand Down Expand Up @@ -645,6 +645,52 @@ making sure that you maintain a proper JSON format.
"template": "textarea",
"markdown": false
},
{
"propertyName": "Custom scripts",
"propertyType": "block",
"propertyKeyword": "customScripts",
"propertyTooltip": "",
"structure": [
{
"propertyName": "Before CREATE TABLE",
"propertyKeyword": "beforeCreateEntity",
"propertyType": "block",
"propertyTooltip": "",
"structure": [
{
"propertyName": "Script",
"propertyKeyword": "script",
"propertyType": "details",
"markdown": false,
"template": "codeEditor",
"templateOptions": {
"editorDialect": "sql",
"customScriptVariables": true
}
}
]
},
{
"propertyName": "After CREATE TABLE",
"propertyKeyword": "afterCreateEntity",
"propertyType": "block",
"propertyTooltip": "",
"structure": [
{
"propertyName": "Script",
"propertyKeyword": "script",
"propertyType": "details",
"markdown": false,
"template": "codeEditor",
"templateOptions": {
"editorDialect": "sql",
"customScriptVariables": true
}
}
]
}
]
},
{
"propertyName": "Remarks",
"propertyKeyword": "comments",
Expand Down
Loading