Skip to content

support mapping postgresql array to a slice #1400

@kuchaguangjie

Description

@kuchaguangjie

Describe the feature

if I added a pg colume role_ids int8[] not null default '{}', and when generate model, want the golang field to be []int64, I can specify the type via gen.FieldType("role_ids", "[]int64")), and generate the code, but when start app, the code won't compile.

So, I'm wondering can you provide a type that support this feature, just like datatypes.JSON would support a json type.

Motivation

generate pg array field as golang slice

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions