Skip to content
Merged
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
14 changes: 4 additions & 10 deletions forward_engineering/dbtProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const { toLower, toUpper } = require('lodash');

const types = require('./configs/types');
const defaultTypes = require('./configs/defaultTypes');
const getKeyHelper = require('./helpers/keyHelper');
const getColumnDefinitionHelper = require('./helpers/columnDefinitionHelper');
const { getColumnConstraints, getCompositeKeyConstraints } = require('./helpers/keyHelper');
const columnDefinitionHelper = require('./helpers/columnDefinitionHelper');

class DbtProvider {
/**
Expand Down Expand Up @@ -62,8 +62,6 @@ class DbtProvider {
* @returns {string}
*/
decorateType({ type, columnDefinition }) {
const columnDefinitionHelper = getColumnDefinitionHelper(this.#appInstance);

return columnDefinitionHelper.decorateType(toUpper(type), columnDefinition);
}

Expand All @@ -72,19 +70,15 @@ class DbtProvider {
* @returns {ConstraintDto[]}
*/
getCompositeKeyConstraints({ jsonSchema }) {
const keyHelper = getKeyHelper(this.#appInstance);

return keyHelper.getCompositeKeyConstraints({ jsonSchema });
return getCompositeKeyConstraints({ jsonSchema });
}

/**
* @param {{ columnDefinition: ColumnDefinition; jsonSchema: JsonSchema }}
* @returns {ConstraintDto[]}
*/
getColumnConstraints({ columnDefinition, jsonSchema }) {
const keyHelper = getKeyHelper(this.#appInstance);

return keyHelper.getColumnConstraints({ columnDefinition });
return getColumnConstraints({ columnDefinition });
}
}

Expand Down
Loading