Skip to content

Documentation on set_type_deserializer #156

Open

Description

@jprjr

Hi there - I was experimenting with setting a custom type deserializer and I think the existing documentation is out of date.

Currently the documentation describes the deserializer function as taking just the value to deserialize:

pgmoon/README.md

Lines 788 to 790 in 2c25f83

pg:set_type_deserializer(20, "bignumber", function(val)
return "HUGENUMBER:" .. val
end)

But what I've observed is the postgres connection is the first argument, and the value to deserialize is the second argument:

pgmoon/pgmoon/init.lua

Lines 940 to 945 in 2c25f83

local fn = self.type_deserializers[data_type]
if fn then
converter = function(v)
return fn(self, v, data_type)
end
end

I'll open a PR with a change

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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