Skip to content

Conversation

@nbesimi
Copy link
Contributor

@nbesimi nbesimi commented May 8, 2023

No description provided.

private static final String TRANSLATION_TABLE_NAME = "TRANSLATION";
private static final String TRANSLATION_ATTRIBUTE_TABLE_NAME = "TRANSLATION_ATTRIBUTE";

private static final String DATABASE_TEMPLATE_TABLE_NAME = "DATABASE_TEMPLATE";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ailegion @jetroni we can put this implementation in a new class or rename the TranslationMatrix to a something more general.

return new BufferedReader(new InputStreamReader(resourceAsStream));
}

private BufferedReader readDatabaseTemplateFile() throws FileNotFoundException {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ailegion for this I did not add an ENV variable. Should we allow users to override the database template file?

@@ -0,0 +1,27 @@
package com.adaptivescale.rosetta.ddl;

public enum DatabaseTemplateEnum {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ailegion @jetroni what do you think about this?

createParams.put("tableName", table.getName());
createParams.put("tableCode", definitionAsString);
stringBuilder.append(TemplateEngine.process(TABLE_CREATE_TEMPLATE, createParams));
Optional.ofNullable(databaseTemplates.get(TABLE_CREATE.getName()))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ailegion @jetroni do you think this is going to be the best way to handle the database templates. How does the databaseTemplates map look like?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this file here because of the unit tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants