Skip to content
This repository was archived by the owner on Jun 20, 2025. It is now read-only.

Add support for AS table_alias syntax for inserts in Postgres#5

Closed
CDThomas wants to merge 1 commit intomainfrom
postgres-insert-alias-support
Closed

Add support for AS table_alias syntax for inserts in Postgres#5
CDThomas wants to merge 1 commit intomainfrom
postgres-insert-alias-support

Conversation

@CDThomas
Copy link
Copy Markdown

Adds support for using table aliases in inserts.

@CDThomas
Copy link
Copy Markdown
Author

Could use some more tests and possibly some refactoring, but this should do it.

Comment thread src/parser/mod.rs
let table = self.parse_keyword(Keyword::TABLE);
let table_name = self.parse_object_name()?;

let is_postgresql = dialect_of!(self is PostgreSqlDialect);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

According to the docs, dialect specific syntax needs to be handled for both the dialect in question and the GenericDialect.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I think that only applies when you need to make changes to the dialect itself. I don't think that matters here, but I'll see what the maintainer says when I raise it upstream.

I still need to check other dialects as well to verify that this needs to be dialect specific.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Isn't this doing exactly that? Changing the dialect?

@CDThomas
Copy link
Copy Markdown
Author

Closing since this has been fixed upstream: apache#1084

@CDThomas CDThomas closed this Aug 27, 2024
@CDThomas CDThomas deleted the postgres-insert-alias-support branch August 27, 2024 00:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants