abergmeier / terraform-provider-exasol

Terraform Provider for Exasol
Apache License 2.0
2 stars 0 forks source link

Enable altering Table columns #15

Open abergmeier opened 3 years ago

abergmeier commented 3 years ago

Currently changing composite enforces a recreation of the table. Would be better to have a logic where the Table Columns are altered.

abergmeier commented 3 years ago

For operations like adding a Column to the end or removing a Column, there is no need to recreate the table. These changes can be incorporated by ALTER TABLE statements.

The problem is, to make this transparent to the user, it would be necessary to implement CustomizeDiff. In turn CustomizeDiff would have to analyze which operation will take place. The operation can be determined in two ways:

  1. Parsing with Exasol SQL Parser
  2. Creating a temporary Table in a Schema

Both seem bad choices because:

  1. There is AFAIK no standalone Exasol SQL Interpreter/Parser. Let alone a library for Go.
  2. There are environments where creating temporary Tables is not desired.

Also this still leaves the need to recreate for adding a Column not to the end. Since this seems like a very popular use-case, disregard the implementation for now.