mgutz / dat

Go Postgres Data Access Toolkit
Other
610 stars 62 forks source link

How do I use custom types or arrays ? #49

Closed macnibblet closed 8 years ago

macnibblet commented 8 years ago

I have implemented a custom type the worked fine with sqlx, but I cannot get it to work here.

The error i'm getting is panic: Could not find struct tag in type PerformerEntity:db:"aliases"`

The mapping


type PerformerEntity struct {
    Id            uint8 `json:"id"`
    ExternalId    uint8 `db:"external_id"json:"externalId"form:"uint8"`

    OriginService string `db:"origin_service"json:"originService"`
    OriginSection *string `db:"origin_section"json:"originSection"`

    StageName     string `db:"stage_name"json:"stageName"`
    Aliases       PGStringArray `json:"aliases"`

    UpdatedAt     time.Time `db:"updated_at"json:"updatedAt"`
    CreatedAt     time.Time `db:"created_at"json:"createdAt"`
}