VOOZH about

URL: https://manpages.org/pgobjecttypejson/3

⇱ man PGObject::Type::JSON (3): JSON wrappers for PGObject


PGObject::Type::JSON(3) JSON wrappers for PGObject

VERSION

Version 1.011.0

SYNOPSIS


PGOBject::Type::JSON->register();

Columns of type json will be converted into hashrefs

 my $obj = PGOBject::Type::JSON->new($hashref);

will now serialize to the database as json.

DESCRIPTION

This module allows json types or others (specified by custom register) types to be converted from into objects according to their values.

This module assumes that encoding will be in across the board and is not safe to use with other database encodings.

SUBROUTINES/METHODS

register(registry => 'default', types => ['json'])

new($ref)

Stores this as a reference. Currently database nulls are stored as cyclical references which is probably a bad idea. In the future we should probably have a lexically scoped table for this.

from_db

serializes from the db. Note that database nulls are preserved distinct from json null's.

to_db

returns undef if is_null. Otherwise returns the value encoded as

reftype

Returns the reftype of the object (i.e. )

is_null

Returns true if is a database null.

AUTHOR

Chris Travers,

BUGS

Please report any bugs or feature requests to , or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=PGObject-Type-JSON>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.
 perldoc PGObject::Type::JSON

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

Copyright 2013 Chris Travers.

This program is released under the following license: