NAME

DBIx::Squirrel::Stages::Taps - stages run for their side effects: peek, count_into, dump_to and tee

SYNOPSIS

use DBIx::Squirrel::Stages::Taps;

DESCRIPTION

DBIx::Squirrel's name for Ekorn::Pipeline::Stages::Taps, which describes its stages in full. It exports peek and count_into by default, and dump_to and tee on request, or all four with :all. They're Ekorn's functions, from a list of DBIx::Squirrel's own, so a stage added there reaches this module only once it's listed here. The module is here to stay, beside DBIx::Squirrel's own stages, such as DBIx::Squirrel::Stages::Rows.

dump_to is for debugging. Where Text::Redact::Secrets v1.x is installed, it writes each secret that module's rules find as *REDACTED*, in the text it writes only: the value passed on is as it came. The rules find a long, random password, token or key, such as the password in a DSN, but not a short or ordinary password, so a dump can still hold secrets. Without the module, or while local $Ekorn::Pipeline::Stages::Taps::DumpSecrets = 1 is set, it writes each value in full; with the module there but broken, it croaks rather than write a dump. It doesn't escape control characters in strings, so a value from outside can send escape sequences to a terminal.

tee(@stages) runs each value through a branch of stages, one run of its own beside the main run, and passes the value on unchanged. The branch shares the main run's context, so pluck and as_hash work in it on a statement's rows. A stop in the branch ends only the branch; a death in it kills the run. It costs a good deal more than peek, so it's for side jobs and debugging.

SEE ALSO

Ekorn::Pipeline::Stages::Taps, DBIx::Squirrel

AUTHOR

Iain Campbell <cpanic@cpan.org>

LICENSE

Copyright (c) 2024-2026 by Iain Campbell.

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