DBD::Go...::stream(3)
π DBD::Go...::stream π
okay bestie, welcome to the manual page for DBD::Gofer::Transport::stream β it's a DBD::Gofer transport that does its whole thing over stdio streaming, and honestly? it's iconic. this is part of the User Contributed Perl Documentation and it's giving remote database realness. let's get into it π«Ά
β¨ NAME β¨
DBD::Gofer::Transport::stream β the DBD::Gofer transport that handles stdio streaming. that's the whole vibe. that's the name. periodt π
π SYNOPSIS π
you wanna connect? say less. you can do it the direct way:
DBI->connect('dbi:Gofer:transport=stream;url=ssh:username@host.example.com;dsn=dbi:...',...)
or, if you're feeling lazy (valid), just set the DBI_AUTOPROXY environment variable and let it cook:
export DBI_AUTOPROXY='dbi:Gofer:transport=stream;url=ssh:username@host.example.com'
π¦ DESCRIPTION π¦
so here's the tea. if you don't pass a url= parameter, it just launches a subprocess like this:
perl -MDBI::Gofer::Transport::stream -e run_stdio_hex
and then it feeds requests into it and reads responses back out of it. cute! butβ¦ ngl, not very useful. it's giving "technically works" energy. π
now, with a url=ssh:username@host.example.com parameter? bestie. it uses ssh to launch that subprocess on a remote system, and that's where it gets good π₯
it hands you secure remote access to DBI databases on literally any system you can log in to. and because ssh is doing the heavy lifting, you also get optional compression and a whole buffet of other features β go peek at the ssh manual for how to configure that and many other options via your ~/.ssh/config file. iykyk π
the actual command it invokes looks something like this:
ssh -xq ssh:username@host.example.com bash -c $setup $run
where $run is the command shown above, and $command is:
. .bash_profile 2>/dev/null || . .bash_login 2>/dev/null || . .profile 2>/dev/null; exec "$@"
which is trying β in a limited and fairly unportable way β to set up the environment (PATH, PERL5LIB, etc.) exactly like it would be if you had actually logged in to that system. it's trying its best, okay? π
also: that "perl" used in the command defaults to the value of $^X whenever you're not using ssh. on most systems that's the full path to the perl that's currently executing. slay β
π PERSISTENCE π
as of right now, gofer stream connections persist (meaning: stay connected) even after all database handles have been disconnected. which means later connections in the same process are very fast. obsessed π
and currently, up to 5 different gofer stream connections (keyed on url) can persist at once. if more than 5 are chillin' in the cache when a new connection shows up, the cache gets cleared before the new connection is added. simple but effective, no notes β¨
π TO DO π
stuff that's still on the vision board:
- document the
go_perlattribute - automatically reconnect (within reason) if there's a transport error
- decide on the default for persistent connection β on or off? limits? ttl?
we'll get there. someday. π§
πΈ AUTHOR πΈ
Tim Bunce, <http://www.tim.bunce.name>
π LICENCE AND COPYRIGHT π
Copyright (c) 2007, Tim Bunce, Ireland. All rights reserved.
this module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. see perlartistic.
π SEE ALSO π
DBD::Gofer::Transport::BaseDBD::Gofer
and that's the whole page, bestie π«Ά this was perl v5.42.3, dated 2026-10-19, and you just read DBD::Go...::stream(3). go forth and stream ur stdio responsibly π
β¨
π¦ where this page comes from
- fedora 43: perl-DBI 1.656-1.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- fedora 44: perl-DBI 1.656-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms