geddy / model

Datastore-agnostic ORM in JavaScript
265 stars 55 forks source link

why finally sql's tablename have `s`or `es` #257

Open class4cxy opened 9 years ago

class4cxy commented 9 years ago

habo = model.register('habo', habo); ==> SELECT habos ....

habo = model.register('habos', habo); ==> SELECT habos ....

habo = model.register('haboss', habo); ==> SELECT habosses ....

danfinlay commented 9 years ago

The pluralization is handled by utilities, a grab-bag of functions that aren't really documented, but are easy to figure out from the source.

String manipulation functions are handled in the string library, and in particular, pluralization is handled here.