gorma icon indicating copy to clipboard operation
gorma copied to clipboard

Auto-ID field creation is broken

Open xeger opened this issue 8 years ago • 1 comments

Gorma's automatic insertion of a primary-key field named "ID" is an excellent way to DRY out my model definitions: https://github.com/goadesign/gorma/blob/master/dsl/relationalmodel.go#L43

Alas, although my models have a field definition for ID, the generated Storage interface is lacking an "ID" parameter, making the auto-ID a bit useless unless I evade the storage layer and interact with gorm directly.

According to @bketelsen:

in a refactor that code never gets called in the order that would make it useful. I would be very appreciative of a PR that solves this

I'm opening this issue to promote awareness/understanding in case anyone else runs into the problem, and perhaps eventually to contribute a fix.

xeger avatar Jun 01 '16 23:06 xeger

PR in progress should resolve this #118

bketelsen avatar Jul 19 '16 16:07 bketelsen