{
    "content": [
        {
            "type": "text",
            "text": "# DBI::Gofer::Execute (perldoc)\n\n## NAME\n\nDBI::Gofer::Execute - Executes Gofer requests and returns Gofer responses\n\n## SYNOPSIS\n\n$executor = DBI::Gofer::Execute->new( { ...config... });\n$response = $executor->executerequest( $request );\n\n## DESCRIPTION\n\nAccepts a DBI::Gofer::Request object, executes the requested DBI method calls, and returns a\nDBI::Gofer::Response object.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **CONFIGURATION** (1 subsections)\n- **DRIVER-SPECIFIC ISSUES**\n- **TESTING**\n- **AUTHOR**\n- **LICENCE AND COPYRIGHT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "DBI::Gofer::Execute",
        "section": "",
        "mode": "perldoc",
        "summary": "DBI::Gofer::Execute - Executes Gofer requests and returns Gofer responses",
        "synopsis": "$executor = DBI::Gofer::Execute->new( { ...config... });\n$response = $executor->executerequest( $request );",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "CONFIGURATION",
                "lines": 60,
                "subsections": [
                    {
                        "name": "update_stats",
                        "lines": 5
                    }
                ]
            },
            {
                "name": "DRIVER-SPECIFIC ISSUES",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "TESTING",
                "lines": 46,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "LICENCE AND COPYRIGHT",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "DBI::Gofer::Execute - Executes Gofer requests and returns Gofer responses\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "$executor = DBI::Gofer::Execute->new( { ...config... });\n\n$response = $executor->executerequest( $request );\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Accepts a DBI::Gofer::Request object, executes the requested DBI method calls, and returns a\nDBI::Gofer::Response object.\n\nAny error, including any internal 'fatal' errors are caught and converted into a\nDBI::Gofer::Response object.\n\nThis module is usually invoked by a 'server-side' Gofer transport module. They usually have\nnames in the \"\"DBI::Gofer::Transport::*\"\" namespace. Examples include:\nDBI::Gofer::Transport::stream and DBI::Gofer::Transport::modperl.\n",
                "subsections": []
            },
            "CONFIGURATION": {
                "content": "checkrequestsub\nIf defined, it must be a reference to a subroutine that will 'check' the request. It is passed\nthe request object and the executor as its only arguments.\n\nThe subroutine can either return the original request object or die with a suitable error\nmessage (which will be turned into a Gofer response).\n\nIt can also construct and return a new request that should be executed instead of the original\nrequest.\n\ncheckresponsesub\nIf defined, it must be a reference to a subroutine that will 'check' the response. It is passed\nthe response object, the executor, and the request object. The sub may alter the response object\nand return undef, or return a new response object.\n\nThis mechanism can be used to, for example, terminate the service if specific database errors\nare seen.\n\nforcedconnectdsn\nIf set, this DSN is always used instead of the one in the request.\n\ndefaultconnectdsn\nIf set, this DSN is used if \"forcedconnectdsn\" is not set and the request does not contain a\nDSN itself.\n\nforcedconnectattributes\nA reference to a hash of connect() attributes. Individual attributes in\n\"forcedconnectattributes\" will take precedence over corresponding attributes in the request.\n\ndefaultconnectattributes\nA reference to a hash of connect() attributes. Individual attributes in the request take\nprecedence over corresponding attributes in \"defaultconnectattributes\".\n\nmaxcacheddbhperdrh\nIf set, the loaded drivers will be checked to ensure they don't have more than this number of\ncached connections. There is no default value. This limit is not enforced for every request.\n\nmaxcachedsthperdbh\nIf set, all the cached statement handles will be cleared once the number of cached statement\nhandles rises above this limit. The default is 1000.\n\nforcedsingleresultset\nIf true, then only the first result set will be fetched and returned in the response.\n\nforcedresponseattributes\nA reference to a data structure that can specify extra attributes to be returned in responses.\n\nforcedresponseattributes => {\nDriverName => {\ndbh => [ qw(dbhattribname) ],\nsth => [ qw(sthattribname) ],\n},\n},\n\nThis can be useful in cases where the driver has not implemented the privateattributeinfo()\nmethod and DBI::Gofer::Execute's own fallback list of private attributes doesn't include the\ndriver or attributes you need.\n\ntrackrecent\nIf set, specifies the number of recent requests and responses that should be kept by the",
                "subsections": [
                    {
                        "name": "update_stats",
                        "content": "Note that this setting can significantly increase memory use. Use with caution.\n\nforcedgoferrandom\nEnable forced random failures and/or delays for testing. See \"DBIGOFERRANDOM\" below.\n"
                    }
                ]
            },
            "DRIVER-SPECIFIC ISSUES": {
                "content": "Gofer needs to know about any driver-private attributes that should have their values sent back\nto the client.\n\nIf the driver doesn't support privateattributeinfo() method, and very few do, then the module\nfallsback to using some hard-coded details, if available, for the driver being used. Currently\nhard-coded details are available for the mysql, Pg, Sybase, and SQLite drivers.\n",
                "subsections": []
            },
            "TESTING": {
                "content": "DBD::Gofer, DBD::Execute and related packages are well tested by executing the DBI test suite\nwith DBIAUTOPROXY configured to route all DBI calls via DBD::Gofer.\n\nBecause Gofer includes timeout and 'retry on error' mechanisms there is a need for some way to\ntrigger delays and/or errors. This can be done via the \"forcedgoferrandom\" configuration item,\nor else the DBIGOFERRANDOM environment variable.\n\nDBIGOFERRANDOM\nThe value of the \"forcedgoferrandom\" configuration item (or else the DBIGOFERRANDOM\nenvironment variable) is treated as a series of tokens separated by commas.\n\nThe tokens can be one of three types:\n\nfail=R%\nSet the current failure rate to R where R is a percentage. The value R can be floating\npoint, e.g., \"fail=0.05%\". Negative values for R have special meaning, see below.\n\nerr=N\nSets the current failure err value to N (instead of the DBI's default 'standard err value'\nof 2000000000). This is useful when you want to simulate a specific error.\n\ndelayN=R%\nSet the current random delay rate to R where R is a percentage, and set the current delay\nduration to N seconds. The values of R and N can be floating point, e.g., \"delay0.5=0.2%\".\nNegative values for R have special meaning, see below.\n\nIf R is an odd number (R % 2 == 1) then a message is logged via warn() which will be\nreturned to, and echoed at, the client.\n\nmethodname\nApplies the current fail, err, and delay values to the named method. If neither a fail nor\ndelay have been set yet then a warning is generated.\n\nFor example:\n\n$executor = DBI::Gofer::Execute->new( {\nforcedgoferrandom => \"fail=0.01%,do,delay60=1%,execute\",\n});\n\nwill cause the do() method to fail for 0.01% of calls, and the execute() method to fail 0.01% of\ncalls and be delayed by 60 seconds on 1% of calls.\n\nIf the percentage value (\"R\") is negative then instead of the failures being triggered randomly\n(via the rand() function) they are triggered via a sequence number. In other words \"\"fail=-20%\"\"\nwill mean every fifth call will fail. Each method has a distinct sequence number.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Tim Bunce, <http://www.tim.bunce.name>\n",
                "subsections": []
            },
            "LICENCE AND COPYRIGHT": {
                "content": "Copyright (c) 2007, Tim Bunce, Ireland. All rights reserved.\n\nThis module is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself. See perlartistic.\n",
                "subsections": []
            }
        }
    }
}