Lift Mapper (Record) camelCase to snake_case for case insensitive databases
Please make the Scala identifier to database identifier translation convention dependent on whether the database supports case sensitive or case insensitive identifiers.
For example, Hibernate offers an Enhanced Naming Convention that translates Java camelCase to a more Oracle friendly snake_case. I am interested in doing the same thing with Lift Mapper/
Record. In the mean time, I need to override dbTableName and dbColumnName, but I'd like to avoid that and just agree on the convention.
I could imagine that the Database Provider would maintain a flag to say whether the database is case sensitive or not, and then based on that flag, would pass either the camelCase directly (for case sensitive), or snake_case(camelCase) (for case insensitive).
I am specifically using Lift Mapper with Oracle, but I think this issue relates to Lift Record too as well as any other case insensitive database.
See discussion: http://groups.google.com/group/liftweb/t/e7f85ede13b303da
For example, Hibernate offers an Enhanced Naming Convention that translates Java camelCase to a more Oracle friendly snake_case. I am interested in doing the same thing with Lift Mapper/
Record. In the mean time, I need to override dbTableName and dbColumnName, but I'd like to avoid that and just agree on the convention.
I could imagine that the Database Provider would maintain a flag to say whether the database is case sensitive or not, and then based on that flag, would pass either the camelCase directly (for case sensitive), or snake_case(camelCase) (for case insensitive).
I am specifically using Lift Mapper with Oracle, but I think this issue relates to Lift Record too as well as any other case insensitive database.
See discussion: http://groups.google.com/group/liftweb/t/e7f85ede13b303da
Leave a comment
(from awhitford on github) When you ask if I raised this on the list, you mean the Google Group, right? I had posted a link to it. The discussion was titled, "camelCase to snake_case." David suggested creating an issue and said, "We'll get it in M8." Alas, I still haven't seen this feature.
The link again is: http://groups.google.com/group/liftweb/browse_thread/thread/e7f85ede13b303da
The link again is: http://groups.google.com/group/liftweb/browse_thread/thread/e7f85ede13b303da
on 2010-02-18 21:05 *
By timperrett
(from github) Given that this is 2 months old, and not been assigned to any committer, did you actually raise this on list? Generally speaking, we only work on tickets that have actually had the nod from David, Marius, Derek or myself (or are solely owned by another committer who will be doing the work) - otherwise we have no way of getting team consensus on a given change. If you still want this, post it on list, link to this issue and go from there.
(from awhitford on github) Having choice isn't a bad idea. I do think that my proposal would be a wise logical default behavior. My main beef is that I need a way to make this change once centrally versus sprinkling override code throughout my model.
Note that this can help avoid a column name being misinterpreted as something offensive... (widgetsHit -> widgets_hit... You get the idea...)
I was hoping that this had made it into M8, but I guess not... I'm crossing my fingers for M9.
Note that this can help avoid a column name being misinterpreted as something offensive... (widgetsHit -> widgets_hit... You get the idea...)
I was hoping that this had made it into M8, but I guess not... I'm crossing my fingers for M9.
on 2010-02-18 21:05 *
By jeppenejsum
(from github) I don't think snake vs camel case should depend on whether the db is case sensitive or not. This could be default, but the naming convention should overrideable (ie for some reason i prefer snake case in databases no matter if it's case sensitive or not :-)