info > DBD::Sponge

📝 NAME

DBD::Sponge - Create a DBI statement handle from Perl data

🚀 Quick Reference

Use CaseCommandDescription
Create a statement handle from static data for testingDBI->connect("dbi:Sponge:","","",{RaiseError=>1})📌 Connect to Sponge driver
Prepare a statement handle with data$sponge->prepare($statement, {rows=>$data, NAME=>$names, %attr})📌 Prepare with data rows and column names
Simulate database queries for unit tests$sth->fetchrow_arrayref📌 Use standard DBI fetch methods on the sponge handle

🔧 SYNOPSIS

my $sponge = DBI->connect("dbi:Sponge:","","",{ RaiseError => 1 });
my $sth = $sponge->prepare($statement, {
        rows => $data,
        NAME => $names,
        %attr
    }
);

📖 DESCRIPTION

DBD::Sponge is useful for making a Perl data structure accessible through a standard DBI statement handle. This may be useful to DBD module authors who need to transform data in this way.

âš™ī¸ METHODS

🔗 connect()

my $sponge = DBI->connect("dbi:Sponge:","","",{ RaiseError => 1 });

Here's a sample syntax for creating a database handle for the Sponge driver. No username and password are needed.

đŸ› ī¸ prepare()

my $sth = $sponge->prepare($statement, {
        rows => $data,
        NAME => $names,
        %attr
    }
);

🐛 BUGS

Using this module to prepare INSERT-like statements is not currently documented.

ÂŠī¸ AUTHOR AND COPYRIGHT

This module is Copyright (c) 2003 Tim Bunce

Documentation initially written by Mark Stosberg

The DBD::Sponge module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. In particular permission is granted to Tim Bunce for distributing this as a part of the DBI.

📚 SEE ALSO

DBI


perl v5.34.0 2026-06-22 DBD::Sponge(3pm)

DBD::Sponge
📝 NAME 🚀 Quick Reference 🔧 SYNOPSIS 📖 DESCRIPTION âš™ī¸ METHODS
🔗 connect() đŸ› ī¸ prepare()
🐛 BUGS ÂŠī¸ AUTHOR AND COPYRIGHT 📚 SEE ALSO

Generated by phpman v4.9.26-5-g7740029 Author: Che Dong Under GNU General Public License
2026-08-16 09:13 @2600:1f28:365:80b0:7cb9:fb:26c1:e368
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
Valid XHTML 1.0 Transitional!Valid CSS!