- LICENSE AND COPYRIGHT
PGObject::Type::JSON - JSON wrappers for PGObject
Columns of type json will be converted into hashrefs
my $obj = PGOBject::Type::JSON->new($hashref);
$obj will now serialize to the database as json.
This module allows json types or others (specified by custom register) types to be converted from JSON into objects according to their values.
This module assumes that encoding will be in UTF8 across the board and is not safe to use with other database encodings.
register(registry => 'default', types => ['json'])
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.
serializes from the db. Note that database nulls are preserved distinct from json null's.
returns undef if is_null. Otherwise returns the value encoded as JSON
Returns the reftype of the object (i.e. HASH, SCALAR, ARRAY)
Returns true if is a database null.
<chris.travers at gmail.com>
Please report any bugs or feature requests to
bug-pgobject-type-json at rt.cpan.org, 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.
You can find documentation for this module with the perldoc command.
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
AnnoCPAN: Annotated CPAN documentation
LICENSE AND COPYRIGHT
Copyright 2013 Chris Travers.
This program is released under the following license: BSD