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
12 changes: 12 additions & 0 deletions forward_engineering/dbtProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ class DbtProvider {
getColumnConstraints({ columnDefinition, jsonSchema }) {
return getColumnConstraints({ columnDefinition, jsonSchema });
}

/**
* @param {{ columnDefinition: ColumnDefinition }}
* @returns {Record<string, unknown>}
*/
getEntityColumnProperties({ columnDefinition }) {
const policyTags = columnDefinition.dbtPolicyTags?.filter(Boolean);

return {
...(policyTags?.length && { policy_tags: policyTags }),
};
}
}

module.exports = DbtProvider;
25 changes: 13 additions & 12 deletions forward_engineering/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
export type ColumnDefinition = {
name: string;
type: string;
isActivated: boolean;
length?: number;
precision?: number;
primaryKey?: boolean;
scale?: number;
dataTypeMode?: string;
name: string;
type: string;
isActivated: boolean;
length?: number;
precision?: number;
primaryKey?: boolean;
scale?: number;
dataTypeMode?: string;
dbtPolicyTags?: string[];
};

export type ConstraintDtoColumn = {
name: string;
isActivated: boolean;
name: string;
isActivated: boolean;
};

export type KeyType = 'PRIMARY KEY' | 'NOT NULL';

export type ConstraintDto = {
keyType: KeyType;
columns?: ConstraintDtoColumn[];
keyType: KeyType;
columns?: ConstraintDtoColumn[];
};

export type JsonSchema = Record<string, unknown>;
Loading