NAME

DBIx::Squirrel::Tooling - DBIx::Squirrel's stages, sinks and words, from one module

SYNOPSIS

use DBIx::Squirrel;
use DBIx::Squirrel::Tooling qw(:all);

my @names = $dbh->iterate(
    'SELECT name, plays FROM track ORDER BY plays DESC',
    take_if { $_->[1] > 6000 },
    pluck('name'),
    keep_all,
);

use DBIx::Squirrel::Tooling qw(:stages :sinks);    # or only some
use DBIx::Squirrel::Tooling qw(pluck keep_all);    # or by name

DESCRIPTION

What a caller uses to do work with DBIx::Squirrel is made in several modules: stages in DBIx::Squirrel::Stages::Flow, Batch, Taps and Rows, Stop, gather and the run's context in modules of their own, sinks, sources and words in Ekorn::Pipeline's, and JSON's sources, sinks and stages in Ekorn::Pipeline::JSON. This module exports all of them, by the tags below, so there's one module to import from, and nothing to remember about which module makes which.

Its tags are Ekorn::Pipeline::Tooling's, with DBIx::Squirrel's own :rows and :context besides, so a caller moving between the two finds the same words. Where both export a name, this module's is DBIx::Squirrel's: today, each such name is the same sub in both, so importing a name from both does no harm.

Each name is the very sub its own module exports, prototype and all, so take_if { ... } and stage { ... } parse as they do imported from there.

Nothing is exported by default: ask for tags, or names, or both. An unknown tag or name is reported by Exporter, as it is for any module.

It leaves out what's for extending the package rather than using it, such as is_stage, from Ekorn::Pipeline, and croakf, from DBIx::Squirrel::Errors: import those from their own modules. And it leaves out what's configured on use: DBIx::Squirrel::Sugar, whose import makes functions for your databases and statements, and Ekorn::Pipeline::Operators, a pragma, which puts | in force only in the scope that uses it, by name.

TAGS

:core

Stop, from DBIx::Squirrel::Stop, and gather, from DBIx::Squirrel::Gather.

:flow

Everything DBIx::Squirrel::Stages::Flow exports: take, take_first, take_last, take_single, take_if, take_while, drop, drop_if and drop_while.

:batch

Everything DBIx::Squirrel::Stages::Batch exports: batch and collect.

:taps

Everything DBIx::Squirrel::Stages::Taps exports: peek, count_into and dump_to.

:rows

Everything DBIx::Squirrel::Stages::Rows exports: pluck and as_hash.

:stages

:flow, :batch, :taps and :rows.

:context

Everything DBIx::Squirrel::Context exports: iterator, result_number and result_original.

:sources

Everything Ekorn::Pipeline::Sources exports: from_array, from_fh, from_file and counter.

:sinks

Everything Ekorn::Pipeline::Sinks exports: count_items, keep, keep_all, keep_first, keep_last, keep_single, to_fh and to_file.

:json

Everything Ekorn::Pipeline::JSON exports: from_json, from_jsonl, to_json and to_jsonl. JSON exports a from_json and a to_json of its own, by default, so a module using both imports :all from only one of them.

:words

Everything Ekorn::Pipeline::Factories exports: pipeline, stage, gather, source, generator and yield, sink_one and sink_many.

:all

All of the above.

A tag holds every name its module exports, by default or on request. What a tag holds is part of the interface: a name may be added to one in a release that only adds, but is dropped or renamed only in a major release.

SEE ALSO

DBIx::Squirrel, Ekorn::Pipeline::Tooling, DBIx::Squirrel::Manual::Reference

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.