8000 Implement dropping functions as `DBAction` by kvch · Pull Request #750 · xataio/pgroll · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Implement dropping functions as DBAction #750

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

Merged
merged 4 commits into from
Mar 26, 2025
Merged

Conversation

kvch
Copy link
Contributor
@kvch kvch commented Mar 25, 2025

I added a new action to drop one or more functions in a single database action.

@kvch kvch mentioned this pull request Mar 25, 2025
16 tasks
@kvch kvch force-pushed the kvch/add-drop-function-action branch 2 times, most recently from 04088d9 to e894d84 Compare March 25, 2025 15:45
@github-actions github-actions bot temporarily deployed to Docs Preview March 25, 2025 15:45 Inactive
@kvch kvch requested a review from andrew-farries March 25, 2025 15:48
@kvch kvch force-pushed the kvch/add-drop-function-action branch from e894d84 to bba03e2 Compare March 25, 2025 17:32
@github-actions github-actions bot temporarily deployed to Docs Preview March 25, 2025 17:32 Inactive
@kvch kvch force-pushed the kvch/add-drop-function-action branch from bba03e2 to 13fb531 Compare March 25, 2025 17:34
@github-actions github-actions bot temporarily deployed to Docs Preview March 25, 2025 17:34 Inactive
@kvch kvch requested a review from andrew-farries March 25, 2025 17:34
Comment on lines 194 to 196
for i, j := 0, 0; i < len(o.Columns); i, j = i+1, j+2 {
dropFuncs[j] = pq.QuoteIdentifier(TriggerFunctionName(o.Table, o.Columns[i]))
dropFuncs[j+1] = pq.QuoteIdentifier(TriggerFunctionName(o.Table, TemporaryName(o.Columns[i])))
dropFuncs = append(dropFuncs, TriggerFunctionName(o.Table, o.Columns[i]))
dropFuncs = append(dropFuncs, TriggerFunctionName(o.Table, TemporaryName(o.Columns[i])))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't need i, j, can just range over o.Columns:

	for _, column := range o.Columns {
		dropFuncs = append(dropFuncs, TriggerFunctionName(o.Table, column))
		dropFuncs = append(dropFuncs, TriggerFunctionName(o.Table, TemporaryName(column)))
	}

@kvch kvch force-pushed the kvch/add-drop-function-action branch from 13fb531 to 1bc3aef Compare March 26, 2025 16:36
@github-actions github-actions bot temporarily deployed to Docs Preview March 26, 2025 16:36 Inactive
@kvch kvch requested a review from andrew-farries March 26, 2025 16:41
@github-actions github-actions bot temporarily deployed to Docs Preview March 26, 2025 16:41 Inactive
@kvch kvch merged commit e3df541 into main Mar 26, 2025
30 checks passed
@kvch kvch deleted the kvch/add-drop-function-action branch March 26, 2025 17:00
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
0