Skip to content

PK issues #186

@noonien

Description

@noonien

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?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions