Hi,

I'm looking at http://github.com/dpp/liftweb/issues#issue/155 and have a
few ideas that I thought I would run by the list

Here's how I think naming is currently handled (I've only looked at
fields, my guess is tables are/should be similar):

- name: always the object name lowercased. Cannot be changed by user
- dbColumnName: by default same as name, unless it's reserved, in which
  case "_c" is appended. Can be overridden by user
- _dbColumnNameLC: internal name used by mapper. Lower cases
  dbColumnName unless the db connection supports mixed case identifiers

I suggest the following changes:

In MapperRules add
  var columnName: String => String = s => s.toLowerCase

(and perhaps tableName, indexName etc. if we want full flexibility)

- name: object name unchanged (ie not lower cased)
- dbColumnName: default is MapperRules.columnName(name) unless this is
  reserved, in which case "_c" is appended.
- _dbColumnNameLC: No change

I like that name is not changed (ie widgetsHit doesn't become widgetshit
:-) but not sure if this breaks anything.

If people want snake_case they can add: 

MapperRules.columnName = ClassHelpers.unCamelCase 

(this strikes me as a rather odd place for this function, but never mind
:-)

Thoughts?

/Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.

Reply via email to