Skip to content

pgtype: enable deep copy of pgtype.Map #2116

@ZhouXing19

Description

@ZhouXing19

I would like to design a "clone" connection function in my program, which takes a parent connection, and run pgx.ConnectConfig() with the same config of the parent connection, and also deep copy the type map of the parent connection.

However, I can't find a way to do such a deep copy, as none of Map.oidToType or nameToType and etc are exported.

So I wonder if we can implement a method like func (m *Map) Clone() Map, or just simply make these not-exported field accessible so that i can loop over entries inside each map.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions