{
    "content": [
        {
            "type": "text",
            "text": "# DBIx::ContextualFetch (perldoc)\n\n## NAME\n\nDBIx::ContextualFetch - Add contextual fetches to DBI\n\n## SYNOPSIS\n\nmy $dbh = DBI->connect(...., { RootClass => \"DBIx::ContextualFetch\" });\n# Modified statement handle methods.\nmy $rv = $sth->execute;\nmy $rv = $sth->execute(@bindvalues);\nmy $rv = $sth->execute(\\@bindvalues, \\@bindcols);\n# In addition to the normal DBI sth methods...\nmy $rowref = $sth->fetch;\nmy @row     = $sth->fetch;\nmy $rowref = $sth->fetchhash;\nmy %row     = $sth->fetchhash;\nmy $rowsref = $sth->fetchall;\nmy @rows     = $sth->fetchall;\nmy $rowsref = $sth->fetchallhash;\nmy @tbl      = $sth->fetchallhash;\n\n## DESCRIPTION\n\nIt always struck me odd that DBI didn't take much advantage of Perl's context sensitivity.\nDBIx::ContextualFetch redefines some of the various fetch methods to fix this oversight. It also\nadds a few new methods for convenience (though not necessarily efficiency).\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **SET-UP**\n- **EXTENSIONS** (1 subsections)\n- **ORIGINAL AUTHOR**\n- **CURRENT MAINTAINER**\n- **LICENSE**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "DBIx::ContextualFetch",
        "section": "",
        "mode": "perldoc",
        "summary": "DBIx::ContextualFetch - Add contextual fetches to DBI",
        "synopsis": "my $dbh = DBI->connect(...., { RootClass => \"DBIx::ContextualFetch\" });\n# Modified statement handle methods.\nmy $rv = $sth->execute;\nmy $rv = $sth->execute(@bindvalues);\nmy $rv = $sth->execute(\\@bindvalues, \\@bindcols);\n# In addition to the normal DBI sth methods...\nmy $rowref = $sth->fetch;\nmy @row     = $sth->fetch;\nmy $rowref = $sth->fetchhash;\nmy %row     = $sth->fetchhash;\nmy $rowsref = $sth->fetchall;\nmy @rows     = $sth->fetchall;\nmy $rowsref = $sth->fetchallhash;\nmy @tbl      = $sth->fetchallhash;",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 20,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "SET-UP",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "EXTENSIONS",
                "lines": 5,
                "subsections": [
                    {
                        "name": "execute",
                        "lines": 47
                    }
                ]
            },
            {
                "name": "ORIGINAL AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "CURRENT MAINTAINER",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "DBIx::ContextualFetch - Add contextual fetches to DBI\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "my $dbh = DBI->connect(...., { RootClass => \"DBIx::ContextualFetch\" });\n\n# Modified statement handle methods.\nmy $rv = $sth->execute;\nmy $rv = $sth->execute(@bindvalues);\nmy $rv = $sth->execute(\\@bindvalues, \\@bindcols);\n\n# In addition to the normal DBI sth methods...\nmy $rowref = $sth->fetch;\nmy @row     = $sth->fetch;\n\nmy $rowref = $sth->fetchhash;\nmy %row     = $sth->fetchhash;\n\nmy $rowsref = $sth->fetchall;\nmy @rows     = $sth->fetchall;\n\nmy $rowsref = $sth->fetchallhash;\nmy @tbl      = $sth->fetchallhash;\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "It always struck me odd that DBI didn't take much advantage of Perl's context sensitivity.\nDBIx::ContextualFetch redefines some of the various fetch methods to fix this oversight. It also\nadds a few new methods for convenience (though not necessarily efficiency).\n",
                "subsections": []
            },
            "SET-UP": {
                "content": "my $dbh = DBIx::ContextualFetch->connect(@info);\nmy $dbh = DBI->connect(@info, { RootClass => \"DBIx::ContextualFetch\" });\n\nTo use this method, you can either make sure that everywhere you normall call DBI->connect() you\neither call it on DBIx::ContextualFetch, or that you pass this as your RootClass. After this DBI\nwill Do The Right Thing and pass all its calls through us.\n",
                "subsections": []
            },
            "EXTENSIONS": {
                "content": "execute\n$rv = $sth->execute;\n$rv = $sth->execute(@bindvalues);\n$rv = $sth->execute(\\@bindvalues, \\@bindcols);\n",
                "subsections": [
                    {
                        "name": "execute",
                        "content": "If called with no arguments, or with a simple list, execute() operates normally. When when\ncalled with two array references, it performs the functions of bindparam, execute and\nbindcolumns similar to the following:\n\n$sth->execute(@bindvalues);\n$sth->bindcolumns(undef, @bindcols);\n\nIn addition, execute will accept tainted @bindvalues. I can't think of what a malicious user\ncould do with a tainted bind value (in the general case. Your application may vary.)\n\nThus a typical idiom would be:\n\n$sth->execute([$this, $that], [\\($foo, $bar)]);\n\nOf course, this method provides no way of passing bind attributes through to bindparam or\nbindcolumns. If that is necessary, then you must perform the bindparam, execute, bindcol\nsequence yourself.\n\nfetch\n$rowref = $sth->fetch;\n@row     = $sth->fetch;\n\nA context sensitive version of fetch(). When in scalar context, it will act as\nfetchrowarrayref. In list context it will use fetchrowarray.\n\nfetchhash\n$rowref = $sth->fetchhash;\n%row     = $sth->fetchhash;\n\nA modification on fetchrowhashref. When in scalar context, it acts just as fetchrowhashref()\ndoes. In list context it returns the complete hash.\n\nfetchall\n$rowsref = $sth->fetchall;\n@rows     = $sth->fetchall;\n\nA modification on fetchallarrayref. In scalar context it acts as fetchallarrayref. In list it\nreturns an array of references to rows fetched.\n\nfetchallhash\n$rowsref = $sth->fetchallhash;\n@rows     = $sth->fetchallhash;\n\nA mating of fetchallarrayref() with fetchrowhashref(). It gets all rows from the hash, each as\nhash references. In scalar context it returns a reference to an array of hash references. In\nlist context it returns a list of hash references.\n"
                    }
                ]
            },
            "ORIGINAL AUTHOR": {
                "content": "Michael G Schwern as part of Ima::DBI\n",
                "subsections": []
            },
            "CURRENT MAINTAINER": {
                "content": "Tony Bowden <tony@tmtm.com>\n",
                "subsections": []
            },
            "LICENSE": {
                "content": "This library is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "DBI. Ima::DBI. Class::DBI.\n",
                "subsections": []
            }
        }
    }
}