-
Notifications
You must be signed in to change notification settings - Fork 70
Closed
Labels
Description
Hello!
I'd like to use kallax in my projects, however, I have some issues with doing this.
I prefer to have my models and store layer in different packages, I would like not to have kallax to import in the models package. I do this by having a new type in the store package for every model I need, for example:
package models
type Foo struct {
ID int `pk:"autoincr"`
Bar string
Baz string
}
package kxstore
import (
kallax "gopkg.in/src-d/go-kallax.v1"
"my-project/models"
)
type Foo struct {
kallax.Model `table:"foos"`
models.Foo
}
When running kallax gen
, i get the following message: kallax: model Foo has no primary key defined
.
Also, some of my models don't have a primary key, does kallax not support models without ids?