Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Truncate method in TestHelper accept structs #59

Closed
wants to merge 1 commit into from

Conversation

jeyhun
Copy link
Contributor

@jeyhun jeyhun commented Aug 22, 2023

Modified the signature of Truncate method in TestHelper interface, making it accept structs rather than DB table names as strings.

Modified the signature of Truncate method in TestHelper interface, making it accept structs rather than DB table names as strings.
@jeyhun jeyhun marked this pull request as ready for review August 22, 2023 18:11
@jeyhun jeyhun self-assigned this Aug 22, 2023
HasTable(tableName string) (bool, error) // Checks if DB table exists
DropTables(records ...Record) error // Drop DB tables by records
Truncate(records ...Record) error // Truncates DB tables
HasTable(tableName string) (bool, error) // Checks if DB table exists
Copy link
Contributor

@krishnamiriyala krishnamiriyala Aug 22, 2023

Choose a reason for hiding this comment

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

@jeyhun please be consistent with interface either we support both tableName and records or just records. I don't want the refactors keep pouring in. You could have the following interface if it makes sense,

DropTables(records ...Record)
DropTablesByName(names ...string)

Please stick to this signature if you are refactoring. Note this would have repercussions once consumers upgrade the library. So it would be better to finalize and make change, else just leave it to callers.

@krishnamiriyala krishnamiriyala marked this pull request as draft October 23, 2023 16:09
@krishnamiriyala krishnamiriyala deleted the test-helper-truncate branch November 6, 2023 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants