Skip to content

Commit

Permalink
remove primarykey from big query
Browse files Browse the repository at this point in the history
  • Loading branch information
invisal committed Oct 20, 2024
1 parent 750f969 commit d44aaf7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/connections/bigquery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,20 @@ export class BigQueryConnection extends SqlConnection {
}
}

createTable(
schemaName: string | undefined,
tableName: string,
columns: TableColumn[]
): Promise<QueryResult> {
// BigQuery does not support PRIMARY KEY. We can remove if here
const tempColumns = structuredClone(columns);
for (const column of tempColumns) {
delete column.definition.primaryKey;
}

return super.createTable(schemaName, tableName, tempColumns);
}

public async fetchDatabaseSchema(): Promise<Database> {
const database: Database = {};

Expand Down

0 comments on commit d44aaf7

Please sign in to comment.