Skip to content

Conversation

@tianzhou
Copy link
Contributor

@tianzhou tianzhou commented Oct 19, 2025

Use parameter as the SOT

Fix #92

Copilot AI review requested due to automatic review settings October 19, 2025 14:49
Copy link
Contributor

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 removes the Arguments and Signature fields from database objects (Function, Procedure, Aggregate) and uses the Parameters array as the single source of truth for parameter information.

  • Removes redundant Arguments and Signature fields from Function, Procedure, and Aggregate structs
  • Adds GetArguments() method to Function for dynamic argument string generation
  • Updates normalization and comparison logic to use the Parameters array exclusively

Reviewed Changes

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

Show a summary per file
File Description
testdata/diff/migrate/v5/plan.json Updates source fingerprint hash for test data
testdata/diff/create_procedure/drop_procedure/plan.json Updates source fingerprint hash for procedure test
testdata/diff/create_procedure/alter_procedure/plan.json Updates source fingerprint hash for procedure test
testdata/diff/create_function/drop_function/plan.json Updates source fingerprint hash for function test
testdata/diff/create_function/alter_function_same_signature/plan.json Updates source fingerprint hash for function test
testdata/diff/create_function/alter_function_different_signature/plan.json Updates source fingerprint hash for function test
testdata/diff/create_function/add_function/plan.txt Adds new parameter note varchar DEFAULT '' to function signature
testdata/diff/create_function/add_function/plan.sql Adds new parameter note varchar DEFAULT '' to function SQL
testdata/diff/create_function/add_function/plan.json Updates SQL statement with new parameter
testdata/diff/create_function/add_function/new.sql Adds new parameter to function definition
testdata/diff/create_function/add_function/diff.sql Shows diff with new parameter added
ir/parser.go Removes code that builds Arguments and Signature strings from parameters
ir/normalize.go Removes signature normalization and updates parameter normalization
ir/ir.go Removes Arguments/Signature fields and adds GetArguments() method
ir/inspector.go Removes population of Arguments and Signature fields
internal/diff/procedure.go Updates to use Parameters array exclusively
internal/diff/function.go Updates to use GetArguments() method and Parameters array
internal/diff/diff.go Updates function key generation to use GetArguments()

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@tianzhou tianzhou merged commit 36326ac into main Oct 19, 2025
2 checks passed
@tianzhou tianzhou deleted the function_varchar branch October 23, 2025 06:34
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.

SQL function results in unresolvable plan drift

1 participant