goadesign / goadesign/gorma

Auto-ID field creation is broken

Open
#106 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
141
Forks
35
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.