pgtype icon indicating copy to clipboard operation
pgtype copied to clipboard

Decoding underlying type

Open crosslogic opened this issue 3 years ago • 0 comments

I have this type type Fecha int

It's value is stored in the database as Date.

It has the functions DecodeBinary, EncodeBinary and seems to work fine.

The problem appears when I try to do Scan on a pointer value:

type Foo struct {
    Date1 Fecha   // Works fine
    Date2 *Fecha 
}

If Date2 is NULL it works fine. If Date2 has a value I get: can't scan into dest[1]: unable to assign to *int

¿How should I handle this?

crosslogic avatar Jan 10 '22 15:01 crosslogic