Jaguar-dart / jaguar_orm

Source-generated ORM with relations (one-to-one, one-to-many, many-to-many), preloading, cascading, polymorphic relations, etc
https://jaguar-dart.github.io
BSD 3-Clause "New" or "Revised" License
217 stars 52 forks source link

Problem with generated Bean and field names #108

Open carmas123 opened 5 years ago

carmas123 commented 5 years ago

Hi I start to use Jaguar ORM for my app and I start from an existing database with some table structure and field names with upper cases and without "_" (underscores) fields name. Now when I try to make my bean with a simple field name like "myName" it is translated to "my_name". This is a big problem when we start to work from an existing database. I think that we can add an annotation to skip the field name translation for all bean, all generation or a single column. I see that we can do that simply editing the "writer.dart" file into _camToSnak function.

Please can you help me please?

tejainece commented 5 years ago

Will fix this.

carmas123 commented 5 years ago

Thank you

tejainece commented 5 years ago

I think by default, we should prefer snake case. But for special cases like this, we should allow skipping snaking casing with a flag.