You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error: expected identifier, found keyword `type`
--> /.../entity/src/mod.rs:36:9
|
36 | pub mod type ;
| ^^^^ expected identifier, found keyword
|
help: escape `type` to use it as an identifier
|
36 | pub mod r#type ;
| ++
error: expected identifier, found keyword `type`
--> /.../entity/src/prelude.rs:34:18
|
34 | pub use super :: type :: Entity as Type ;
| ^^^^ expected identifier, found keyword
|
help: escape `type` to use it as an identifier
|
34 | pub use super :: r#type :: Entity as Type ;
| ++
Description
I have a database with a table named
type
. When I runsea-orm-cli
it generates syntactically invalid code.mod type;
should bemod r#type;
use crate::type::Entity
should beuse crate::r#type::Entity
Steps to Reproduce
type
(probably any rust keyword gives the same resull)cargo new bug ; cd bug
sea-orm-cli generate entity -u mysql://user:pw@localhost/db -o entity/src
Expected Behavior
Generated code should be valid.
Actual Behavior
Generated code does not compile.
Reproduces How Often
Always
Versions
Additional Information
It seems like code generated by
DeriveRelation
macro also has this issue.The text was updated successfully, but these errors were encountered: