Skip to content

Add ADR for column visibility feature#2222

Merged
jzabroski merged 4 commits into
mainfrom
copilot/create-adr-for-column-visibility
Jan 17, 2026
Merged

Add ADR for column visibility feature#2222
jzabroski merged 4 commits into
mainfrom
copilot/create-adr-for-column-visibility

Conversation

Copilot AI commented Jan 16, 2026

Copy link
Copy Markdown
Contributor

Many databases support hiding columns from SELECT * queries (SQL Server's HIDDEN, Oracle/MySQL/MariaDB's INVISIBLE, DB2's IMPLICITLY HIDDEN). FluentMigrator currently requires raw SQL for this feature. This ADR documents database support and proposes a fluent API design.

Changes

  • Created adr/proposed/ColumnVisibility.md documenting:
    • Database support matrix with separate syntax columns for CREATE TABLE, ALTER TABLE ADD COLUMN, and ALTER TABLE ALTER COLUMN operations
    • Support for 5 database providers: SQL Server 2016+, Oracle 12c+, MySQL 8.0.23+, MariaDB 10.3+, and DB2 v9.7+
    • Proposed Hidden() and Visible() methods on column builders
    • Implementation strategy for version-gated generator support
    • Alternative approaches and recommendations

Proposed API

Create.Table("Users")
    .WithColumn("Id").AsInt32().PrimaryKey()
    .WithColumn("CreatedDate").AsDateTime().Hidden()
    .WithColumn("RowVersion").AsBinary(8).Hidden();

// Toggle visibility
Alter.Column("LegacyField").OnTable("Products")
    .AsString(100).Visible();

No implementation included per issue requirements.

Original prompt

This section details on the original issue you should resolve

<issue_title>Create an ADR for column visibility</issue_title>
<issue_description>Is your feature request related to a problem? Please describe.
Many database management providers support the HIDDEN keyword or VISIBLE/INVISIBLE keywords to hide columns from wildcard operations like SELECT *. When using data access layers like EntityFrameworkCore, certain columns are expected to be hidden. Currently, FluentMigrator does not provide support for such operations, other than to manually create the columns using an "escape hatch" to raw SQL execution, like Execute.Sql, Execute.EmbeddedScript, or Execute.WithConnection

Describe the solution you'd like
Create a file in the top-level adr folder to describe each database providers support for column visibility toggles.
Propose, but do not implement, an API that extends the existing Create.Column and Create.Table("Example").WithColumn("HiddenColumn") with a visibility toggle API.

Additional context
This is unrelated to data masking features introduced to support GDPR.
</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Create ADR for column visibility support in database management Add ADR for column visibility feature Jan 16, 2026
Copilot AI requested a review from jzabroski January 16, 2026 14:15
@jzabroski

Copy link
Copy Markdown
Collaborator

@copilot You missed some providers.

DB2 supports it via "IMPLICITLY HIDDEN" syntax; See https://www.ibm.com/docs/en/db2/12.1.x?topic=concepts-hidden-columns

Example 1: In the following statement, a table is created with an implicitly hidden column.

     CREATE TABLE CUSTOMER
     (
       CUSTOMERNO       INTEGER NOT NULL,
       CUSTOMERNAME     VARCHAR(80),
       PHONENO          CHAR(8) IMPLICITLY HIDDEN
     );

Copilot AI commented Jan 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot You missed some providers.

DB2 supports it via "IMPLICITLY HIDDEN" syntax; See https://www.ibm.com/docs/en/db2/12.1.x?topic=concepts-hidden-columns
...

Added DB2 support with IMPLICITLY HIDDEN syntax to the ADR. Updated the support matrix, generator implementation examples, version-specific support section, ALTER COLUMN considerations, and constraints/limitations to include DB2 v9.7+. (b665377)

@jzabroski

Copy link
Copy Markdown
Collaborator

@copilot
I think we should replace the "Syntax" column in your grid with a "CREATE TABLE syntax" column and an "ALTER TABLE ADD COLUMN syntax" column and an "ALTER TABLE ALTER COLUMN syntax" column. The existing DB2 example is "CREATE TABLE syntax".

  1. The "ALTER TABLE ADD COLUMN" syntax for DB2 is here: https://www.ibm.com/docs/en/db2/12.1.x?topic=statements-alter-table#sdx-synid_column-options
  2. The "ALTER TABLE ALTER COLUMN" syntax for DB2 is: ALTER TABLE <table-name> ALTER COLUMN <column-name> SET {NOT HIDDEN | IMPLICITLY HIDDEN}

Copilot AI commented Jan 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot
I think we should replace the "Syntax" column in your grid with a "CREATE TABLE syntax" column and an "ALTER TABLE ADD COLUMN syntax" column and an "ALTER TABLE ALTER COLUMN syntax" column....

Restructured the table with separate columns for CREATE TABLE, ALTER TABLE ADD COLUMN, and ALTER TABLE ALTER COLUMN syntax. Updated DB2 to include both IMPLICITLY HIDDEN and NOT HIDDEN keywords, with proper ALTER COLUMN syntax (SET IMPLICITLY HIDDEN / SET NOT HIDDEN). Added DB2 ALTER TABLE Statement reference link. (91d9c74)

@jzabroski

Copy link
Copy Markdown
Collaborator

@PhenX Think this looks great. Thoughts? I agree with copilot's default recommendation

@PhenX

PhenX commented Jan 16, 2026

Copy link
Copy Markdown
Collaborator

Yep looks good!

@jzabroski

Copy link
Copy Markdown
Collaborator

I think my new approach is going to be to model feature enhancements this way. First have Copilot explain its thinking, then create a separate issue for it to go implement it.

@jzabroski
jzabroski marked this pull request as ready for review January 17, 2026 00:26
@jzabroski
jzabroski merged commit 221813d into main Jan 17, 2026
3 checks passed
@jzabroski
jzabroski deleted the copilot/create-adr-for-column-visibility branch January 17, 2026 00:26
@jzabroski jzabroski added this to the 8.1.0 milestone Jan 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create an ADR for column visibility

3 participants