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

Escape rust keywords with r# raw identifier #224

Merged
merged 5 commits into from
Oct 7, 2021
Merged

Escape rust keywords with r# raw identifier #224

merged 5 commits into from
Oct 7, 2021

Conversation

billy1624
Copy link
Member

Resolve #217

@billy1624 billy1624 self-assigned this Oct 4, 2021
@billy1624 billy1624 marked this pull request as ready for review October 5, 2021 14:00
Copy link
Member

@tyt2y3 tyt2y3 left a comment

Choose a reason for hiding this comment

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

Where the r#self?
Is it because it is problematic because of the upper case Self?

@billy1624
Copy link
Member Author

r#self and r#Self are not possible. 🦀 won't compile loll

@tyt2y3
Copy link
Member

tyt2y3 commented Oct 6, 2021

okay so https://internals.rust-lang.org/t/raw-identifiers-dont-work-for-all-identifiers/9094
then how can we handle self, crate, super?
extern apparently now works.

@billy1624
Copy link
Member Author

Append underscore behind these three?

@tyt2y3
Copy link
Member

tyt2y3 commented Oct 6, 2021

Append underscore behind these three?

I think so

@billy1624
Copy link
Member Author

See d6b53ab

@tyt2y3
Copy link
Member

tyt2y3 commented Oct 6, 2021

Seems nice.

@billy1624
Copy link
Member Author

Seems nice.

Test case seems promising? loll

Copy link
Member

@tyt2y3 tyt2y3 left a comment

Choose a reason for hiding this comment

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

Promising

@tyt2y3 tyt2y3 merged commit 98e48cf into master Oct 7, 2021
@tyt2y3 tyt2y3 deleted the rust-keywords branch October 7, 2021 08:35
tyt2y3 added a commit that referenced this pull request Oct 7, 2021
Escape rust keywords with `r#` raw identifier
arpancodes pushed a commit to arpancodes/sea-orm that referenced this pull request Apr 8, 2022
@JellyWX
Copy link

JellyWX commented May 15, 2022

looks that macro is missing from the identifier list here

@billy1624
Copy link
Member Author

Hey @JellyWX, do you mean macro isn't included in the list of keyword?

@JellyWX
Copy link

JellyWX commented May 16, 2022

Yes, seems so. Just ran into the generation issue with a table named "macro"

@billy1624
Copy link
Member Author

I think that's another problem. Could you please elaborate it on a new issue? Thanks!!

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.

sea-orm-cli: Entity generation fails if column name is a reserved keyword
3 participants