STORABLE_freeze
=for Pod::Coverage STORABLE_thaw
=for Pod::Coverage THAW
=for Pod::Coverage TO_JSON
Serialisation by L<CBOR|CBOR::XS>, L<Sereal> and L<Storable::Improved> (or the legacy L<Storable
me]);
Writes all rows into an Excel file.
=item L<json|DBIx::DataModel::Schema::ResultAs::Json>
Converts all rows to JSON format, using L<JSON::MaybeXS>.
=item L<yaml|DBIx::DataModel::Schema::Re
.
=head3 TO_JSON
use JSON;
my $json_converter = JSON->new->convert_blessed(1);
my $json_text = $json_converter->encode($data_row);
The C<Source> class implements a C<TO_JSON> method, so
e easily converted into JSON strings
(including nested rows that may have been added by the L</expand> method).
See L<JSON/convert_blessed> for more explanations.
The C<TO_JSON> method merely copies
handle serializing and deserializing data between
Perl data structures and different formats like JSON, YAML, or XML.
All serializer engines must implement the L<Dancer2::Core::Role::Serializer>
role
STORABLE_freeze
=for Pod::Coverage STORABLE_thaw
=for Pod::Coverage THAW
=for Pod::Coverage TO_JSON
Serialisation by L<CBOR|CBOR::XS>, L<Sereal> and L<Storable> is supported by this package. To th
s can often be ignored; but nevertheless they can be a problem
with some external modules like L<JSON> that croak when encoding
a blessed reference. In that case you can use the C<unbless()> functio
essing is
recursively applied to nested datastructures :
$schema->unbless($rows);
my $json = JSON->new->encode($rows);
=head2 Common table expressions (WITH RECURSIVE)
The SQL syntax
ONVERSION
=head2 JSON
use JSON;
my $json_converter = JSON->new->convert_blessed(1);
my $json_text = $json_converter->encode($data_row);
By default, the L<JSON> module refuses to
post_processing
=for Pod::Coverage STORABLE_thaw
=for Pod::Coverage THAW
=for Pod::Coverage TO_JSON
Serialisation by L<CBOR|CBOR::XS>, L<Sereal> and L<Storable::Improved> (or the legacy L<Storable
Nice::Try;
# This is disruptive for everybody. Bad idea.
# use JSON 4.03 qw( -convert_blessed_universally );
use JSON 4.03;
use Scalar::Util ();
# use Storable 3.25 ();
use Sto
sing it as a choice to the user, but defaults to JSON.
# Other possibilities could be cbor, sereal and storable
$self->{_packing_method} = 'json';
$self->SUPER::init( @_ ) || return( $self
) );
}
sub id { return( shift->_set_get_scalar( 'id', @_ ) ); }
sub json { return( shift->_packing_method( 'json' ) ); }
sub key
{
my $self = shift( @_ );
if( @_ )
{
$se
ata::UUID;
# This is disruptive for everybody. Bad idea.
# use JSON 4.03 qw( -convert_blessed_universally );
use JSON 4.03;
use Module::Generic::File qw( file sys_tmpdir );
our $HA
$self->{serial} = '';
$self->{size} = 0;
$self->{_packing_method} = 'json';
$self->{_init_strict_use_sub} = 1;
$self->SUPER::init( @_ ) || return( $self->pass_erro
stMmap' ) ); }
sub id { return( shift->_set_get_scalar( 'id', @_ ) ); }
sub json { return( shift->_packing_method( 'json' ) ); }
# sub key { return( shift->_set_get_scalar( 'key', @_ ) ); }
sub key
STORABLE_freeze
=for Pod::Coverage STORABLE_thaw
=for Pod::Coverage THAW
=for Pod::Coverage TO_JSON
Serialisation by L<CBOR|CBOR::XS>, L<Sereal> and L<Storable::Improved> (or the legacy L<Storable
rayref>
=item L<Hashref|DBIx::DataModel::Schema::ResultAs::Hashref>
=item L<Json|DBIx::DataModel::Schema::ResultAs::Json>
=item L<Rows|DBIx::DataModel::Schema::ResultAs::Rows>
=item L<Sql|DBIx::Da
y one field '__schema'
my @k = keys %$self;
return @k == 1 && $k[0] eq '__schema';
}
sub TO_JSON {
my $self = shift;
my $clone = {%$self};
delete $clone->{__schema};
return $clone;
}
1
::Util ();
# This is disruptive for everybody. Bad idea.
# use JSON 4.03 qw( -convert_blessed_universally );
use JSON 4.03;
use Module::Generic::Global ':const';
use Storable::Impr
# I leave the feature of using it as a choice to the user, but defaults to JSON
$self->{_packing_method} = 'json';
$self->SUPER::init( @_ ) || return( $self->pass_error );
$self->{own
$self->error( "Error with \$shm->id: $@" ) );
}
return( $rv );
}
sub json { return( shift->_packing_method( 'json' ) ); }
sub key
{
my $self = shift( @_ );
if( @_ )
{
my
Fastly::Object::TopWorkspace;
require 5.6.0;
use strict;
use warnings;
use utf8;
use JSON::MaybeXS qw(decode_json);
use Data::Dumper;
use Module::Runtime qw(use_module);
use Log::Any qw($log);
use Da
f = shift;
my $_hash = decode_json(JSON()->new->allow_blessed->convert_blessed->encode($self));
return $_hash;
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $
serialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key};
my $_is_nullable = ($self->openapi_nullable->{
DdosProtectionInvalidRequest;
require 5.6.0;
use strict;
use warnings;
use utf8;
use JSON::MaybeXS qw(decode_json);
use Data::Dumper;
use Module::Runtime qw(use_module);
use Log::Any qw($log);
use Da
f = shift;
my $_hash = decode_json(JSON()->new->allow_blessed->convert_blessed->encode($self));
return $_hash;
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $
serialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key};
my $_is_nullable = ($self->openapi_nullable->{
Fastly::Object::AttackSignal;
require 5.6.0;
use strict;
use warnings;
use utf8;
use JSON::MaybeXS qw(decode_json);
use Data::Dumper;
use Module::Runtime qw(use_module);
use Log::Any qw($log);
use Da
f = shift;
my $_hash = decode_json(JSON()->new->allow_blessed->convert_blessed->encode($self));
return $_hash;
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $
serialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key};
my $_is_nullable = ($self->openapi_nullable->{
Object::ListAttackReportMeta;
require 5.6.0;
use strict;
use warnings;
use utf8;
use JSON::MaybeXS qw(decode_json);
use Data::Dumper;
use Module::Runtime qw(use_module);
use Log::Any qw($log);
use Da
f = shift;
my $_hash = decode_json(JSON()->new->allow_blessed->convert_blessed->encode($self));
return $_hash;
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $
serialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key};
my $_is_nullable = ($self->openapi_nullable->{
Fastly::Object::SignalReport;
require 5.6.0;
use strict;
use warnings;
use utf8;
use JSON::MaybeXS qw(decode_json);
use Data::Dumper;
use Module::Runtime qw(use_module);
use Log::Any qw($log);
use Da
f = shift;
my $_hash = decode_json(JSON()->new->allow_blessed->convert_blessed->encode($self));
return $_hash;
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $
serialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key};
my $_is_nullable = ($self->openapi_nullable->{
ly::Object::TimeseriesResult;
require 5.6.0;
use strict;
use warnings;
use utf8;
use JSON::MaybeXS qw(decode_json);
use Data::Dumper;
use Module::Runtime qw(use_module);
use Log::Any qw($log);
use Da
f = shift;
my $_hash = decode_json(JSON()->new->allow_blessed->convert_blessed->encode($self));
return $_hash;
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $
serialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key};
my $_is_nullable = ($self->openapi_nullable->{
Fastly::Object::AttackSource;
require 5.6.0;
use strict;
use warnings;
use utf8;
use JSON::MaybeXS qw(decode_json);
use Data::Dumper;
use Module::Runtime qw(use_module);
use Log::Any qw($log);
use Da
f = shift;
my $_hash = decode_json(JSON()->new->allow_blessed->convert_blessed->encode($self));
return $_hash;
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $
serialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key};
my $_is_nullable = ($self->openapi_nullable->{
:DdosProtectionNotAuthorized;
require 5.6.0;
use strict;
use warnings;
use utf8;
use JSON::MaybeXS qw(decode_json);
use Data::Dumper;
use Module::Runtime qw(use_module);
use Log::Any qw($log);
use Da
f = shift;
my $_hash = decode_json(JSON()->new->allow_blessed->convert_blessed->encode($self));
return $_hash;
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $
serialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key};
my $_is_nullable = ($self->openapi_nullable->{