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

Support multiple tables in TRUNCATE command #1000

Closed
wants to merge 1 commit into from

Conversation

mdashti
Copy link

@mdashti mdashti commented Oct 12, 2023

The truncate command can accept a list of tables (as per the documentation: https://www.postgresql.org/docs/current/sql-truncate.html). This PR fixes the current limitation that only one table can be used in the TRUNCATE command.

@alamb alamb changed the title Fixed the TRUNCATE command parsing to cover PostgreSQL syntax Support multiple tables in TRUNCATE command Oct 20, 2023
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you @mdashti - this PR looks good to me, though I have a small suggestion for improvement

partitions,
table,
} => {
let table = if *table { "TABLE " } else { "" };
write!(f, "TRUNCATE {table}{table_name}")?;
write!(
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps you can use display_comma_separated here instead of making a a new Vec via join

@alamb alamb marked this pull request as draft October 24, 2023 11:21
@alamb
Copy link
Contributor

alamb commented Oct 24, 2023

Converting to draft as CI is failing. Please mark as ready for review when it is

Copy link

github-actions bot commented Jul 9, 2024

Thank you for your contribution. Unfortunately, this pull request is stale because it has been open 60 days with no activity. Please remove the stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jul 9, 2024
@alamb alamb closed this Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants