Skip to content

Commit 84800c3

Browse files
committed
fix(etl-processes): if there are no columns with _pk, do not append primary keys with empty ()
1 parent d2cdf74 commit 84800c3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/etl-processes.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ export function checkPrimaryKey(col: string): boolean {
9090
}
9191

9292
export function formatPrimaryKey(formatColumnsResult: FormatColumnsResult): string[] {
93+
94+
if (formatColumnsResult.primaryKeyIndex.length < 1) {
95+
return formatColumnsResult.formattedColumns;
96+
}
97+
9398
if (formatColumnsResult.primaryKeyIndex.length === 1) {
9499
const primaryColumn = formatColumnsResult.formattedColumns[formatColumnsResult.primaryKeyIndex[0]].concat(` ${SQLKeyword.PRIMARY_KEY}`);
95100

0 commit comments

Comments
 (0)