NyxCode / ormx

bringing orm-like features to sqlx
MIT License
287 stars 32 forks source link

Reserved keyword `default` not escaped #19

Closed Kinrany closed 5 days ago

Kinrany commented 2 years ago

I have an existing database with a column named default. The ormx::Table macro does not escape it in the generated SQL, causing cargo sqlx prepare to fail.

I reproduced it here: https://github.com/Kinrany/ormx-escape-default-repro

This seems to be a regression because it has been addressed in https://github.com/NyxCode/ormx/issues/1

Kinrany commented 2 years ago

Ah, looks like the list of reserved identifiers is empty for MySQL: https://github.com/NyxCode/ormx/blob/1a15e30d41bff74d676b70f6f05fd99cb83f0c3c/ormx-macros/src/backend/mysql/mod.rs#L14

Would it be helpful to send a PR with an incomplete list of reserved identifiers for MySQL?

NyxCode commented 5 days ago

fixed in #40

Kinrany commented 4 days ago

Thanks @Punie!