Closed rconnol closed 1 year ago
create type season_type as enum ('Regular Season', 'Playoffs', 'Pre Season', 'All Star'); create table seasons ( season_id integer not null, league_id smallint not null, season_name varchar not null, season_type season_type not null, updated_at timestamp default now() not null, created_at timestamp default now() not null, primary key (season_id, league_id) );
I have a table with a custom postgres enum defined. I defined the enum using the human readable spellings of the SeasonType values.
When I generate the code with cornucopia, the generated Rust code is invalid... and I get the following error:
error: expected one of `(`, `,`, `=`, `{`, or `}`, found `Season` --> bucket-list-etl/src/cornucopia.rs:5:62 | 5 | #[allow(non_camel_case_types)] pub enum SeasonType { Regular Season,Playoffs,Pre Season,All Star,}impl < 'a > postgres_types :: ToSql for... | -^^^^^^ expected one of `(`, `,`, `=`, `{`, or `}` | | | help: missing `,`
My hunch is that other valid special characters like "dashes", might cause a similar issue.
Will be fixed by #185
@rconnol this should be fixed by #185 now that it has been merged!
Thanks for reporting the issue, please let us know if there's still a problem.
Cheers :smile:
I have a table with a custom postgres enum defined. I defined the enum using the human readable spellings of the SeasonType values.
When I generate the code with cornucopia, the generated Rust code is invalid... and I get the following error:
My hunch is that other valid special characters like "dashes", might cause a similar issue.