Skip to content

Use ALL_TAB_COLUMNS that does not show hidden columns by default#252

Merged
yahonda merged 1 commit intorsim:masterfrom
yahonda:exclude-hidden-columns
Apr 13, 2026
Merged

Use ALL_TAB_COLUMNS that does not show hidden columns by default#252
yahonda merged 1 commit intorsim:masterfrom
yahonda:exclude-hidden-columns

Conversation

@yahonda
Copy link
Copy Markdown
Collaborator

@yahonda yahonda commented Apr 13, 2026

Summary

  • Use ALL_TAB_COLUMNS instead of ALL_TAB_COLS in get_field_definitions to exclude hidden columns (e.g., those created by functional indexes)
  • ALL_TAB_COLUMNS excludes hidden columns by default and is available in Oracle 11g and newer

Based on #208

Test plan

  • Verify test workflow passes (Oracle 23c Free)
  • Verify test_11g workflow passes (Oracle 11g XE)
  • New test creates a table with a functional index (which generates a hidden column) and verifies hidden columns are excluded from field definitions

Co-Authored-By: Jochen Schug 4573581+joschug@users.noreply.github.com

Generated with Claude Code

@yahonda yahonda force-pushed the exclude-hidden-columns branch 6 times, most recently from fd2a325 to ea28e73 Compare April 13, 2026 01:57
@yahonda yahonda marked this pull request as draft April 13, 2026 01:57
@yahonda yahonda force-pushed the exclude-hidden-columns branch from ea28e73 to 3759bfc Compare April 13, 2026 02:00
@yahonda yahonda marked this pull request as ready for review April 13, 2026 02:00
@yahonda yahonda changed the title Exclude hidden columns from table type field definitions Use ALL_TAB_COLUMNS that does not show hidden columns by default Apr 13, 2026
@yahonda yahonda requested a review from Copilot April 13, 2026 02:26
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates how %ROWTYPE field definitions are derived for table/view-backed record types by switching the data dictionary view used to read columns, with a new spec to ensure hidden columns created by functional indexes are excluded.

Changes:

  • Replace ALL_TAB_COLS with ALL_TAB_COLUMNS in get_field_definitions for table/view column discovery.
  • Add a regression spec that creates a functional index (which introduces a hidden column) and asserts hidden columns do not appear in %ROWTYPE fields.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
lib/plsql/procedure.rb Uses ALL_TAB_COLUMNS when building field metadata for TABLE/VIEW %ROWTYPE records to avoid hidden columns.
spec/plsql/procedure_spec.rb Adds a regression test ensuring hidden columns (e.g., SYS_NC...) are excluded from %ROWTYPE field definitions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Use ALL_TAB_COLUMNS instead of ALL_TAB_COLS in get_field_definitions
to exclude hidden columns (e.g., those created by functional indexes).
ALL_TAB_COLUMNS excludes hidden columns by default.

Co-Authored-By: Jochen Schug <4573581+joschug@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yahonda yahonda merged commit 5f3c0a9 into rsim:master Apr 13, 2026
22 checks passed
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.

2 participants