SeaQL / sea-query

🔱 A dynamic SQL query builder for MySQL, Postgres and SQLite
https://www.sea-ql.org
Other
1.13k stars 185 forks source link

enum_def could derive IdenStatic #721

Open jclulow opened 9 months ago

jclulow commented 9 months ago

Looking at the enum_def attribute macro, it seems like it only produces an Iden implementation, but I'm not sure there is any reason it couldn't also derive an IdenStatic implementation?

I'd like to use the IdenStatic.as_str() routine for column variants in rusqlite row conversion routines. The Row.get() routine will accept a &str as an index, which would then avoid allocating for column names on each row conversion.

Does that seem reasonable?

tyt2y3 commented 9 months ago

Yes, you are right. IdenStatic was added much later than the enum_def macro, that's why. PR is welcome.