Skip to content
Teng's plugin which enables/disables suppress_row_objects with guard object.
Perl
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib/Teng/Plugin
t
.gitignore
.mailmap
.travis.yml
Build.PL
Changes
LICENSE
META.json
README.md
cpanfile
minil.toml

README.md

Build Status Coverage Status

NAME

Teng::Plugin::RowObjectCreationSwitcher - Teng plugin which enables/disables suppress_row_objects with guard object

SYNOPSIS

use MyProj::DB;
use parent qw(Teng);
__PACKAGE__->load_plugin('RowObjectCreationSwitcher');

package main;
my $db = MyProj::DB->new(dbh => $dbh);
{
    my $guard = $db->temporary_suppress_row_objects_guard(1); # row object creation is suppressed
    {
        my $guard2 = $db->temporary_suppress_row_objects_guard(1); # row object is created. (isn't suppressed)
        ... # do something
    }
    # dismiss $guard2 (row object creation is suppressed)
    ... # do something
}
# dismiss $guard (row object creation is unsuppressed)

DESCRIPTION

Teng::Plugin::RowObjectCreationSwitcher is plugin for Teng which provides switcher to enable/disable to generate row object. This switcher returns guard object and if guard is dismissed, status is back to previous.

METHODS

$guard = $self->temporary_suppress_row_objects_guard($bool_suppress_row_objects)

set suppress_row_objects and return guard object. When guard is dismissed, status is back to previous.

LICENSE

Copyright (C) Takuya Tsuchida.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

Takuya Tsuchida tsucchi@cpan.org

Something went wrong with that request. Please try again.