{
    "content": [
        {
            "type": "text",
            "text": "# DBI::DBD::SqlEngine (info)\n\n## NAME\n\nDBI::DBD::SqlEngine - Base class for DBI drivers without their own SQL engine\n\n## SYNOPSIS\n\npackage DBD::myDriver;\nuse base qw(DBI::DBD::SqlEngine);\nsub driver\n{\n...\nmy $drh = $proto->SUPER::driver($attr);\n...\nreturn $drh->{class};\n}\npackage DBD::myDriver::dr;\n@ISA = qw(DBI::DBD::SqlEngine::dr);\nsub datasources { ... }\n...\npackage DBD::myDriver::db;\n@ISA = qw(DBI::DBD::SqlEngine::db);\nsub initvalidattributes { ... }\nsub initdefaultattributes { ... }\nsub setversions { ... }\nsub validateSTOREattr { my ($dbh, $attrib, $value) = @; ... }\nsub validateFETCHattr { my ($dbh, $attrib) = @; ... }\nsub getmydversions { ... }\nsub getavailtables { ... }\npackage DBD::myDriver::st;\n@ISA = qw(DBI::DBD::SqlEngine::st);\nsub FETCH { ... }\nsub STORE { ... }\npackage DBD::myDriver::Statement;\n@ISA = qw(DBI::DBD::SqlEngine::Statement);\nsub opentable { ... }\npackage DBD::myDriver::Table;\n@ISA = qw(DBI::DBD::SqlEngine::Table);\nsub new { ... }\n\n## DESCRIPTION\n\nDBI::DBD::SqlEngine abstracts the usage of SQL engines from the DBD.\nDBD authors can concentrate on the data retrieval they want to provide.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **SQL ENGINES**\n- **SUPPORT**\n- **ACKNOWLEDGEMENTS**\n- **AUTHOR**\n- **COPYRIGHT AND LICENSE**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "DBI::DBD::SqlEngine",
        "section": "",
        "mode": "info",
        "summary": "DBI::DBD::SqlEngine - Base class for DBI drivers without their own SQL engine",
        "synopsis": "package DBD::myDriver;\nuse base qw(DBI::DBD::SqlEngine);\nsub driver\n{\n...\nmy $drh = $proto->SUPER::driver($attr);\n...\nreturn $drh->{class};\n}\npackage DBD::myDriver::dr;\n@ISA = qw(DBI::DBD::SqlEngine::dr);\nsub datasources { ... }\n...\npackage DBD::myDriver::db;\n@ISA = qw(DBI::DBD::SqlEngine::db);\nsub initvalidattributes { ... }\nsub initdefaultattributes { ... }\nsub setversions { ... }\nsub validateSTOREattr { my ($dbh, $attrib, $value) = @; ... }\nsub validateFETCHattr { my ($dbh, $attrib) = @; ... }\nsub getmydversions { ... }\nsub getavailtables { ... }\npackage DBD::myDriver::st;\n@ISA = qw(DBI::DBD::SqlEngine::st);\nsub FETCH { ... }\nsub STORE { ... }\npackage DBD::myDriver::Statement;\n@ISA = qw(DBI::DBD::SqlEngine::Statement);\nsub opentable { ... }\npackage DBD::myDriver::Table;\n@ISA = qw(DBI::DBD::SqlEngine::Table);\nsub new { ... }",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "SqlEngine",
                "section": "3pm",
                "url": "https://www.chedong.com/phpMan.php/man/SqlEngine/3pm/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 50,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 407,
                "subsections": []
            },
            {
                "name": "SQL ENGINES",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "SUPPORT",
                "lines": 38,
                "subsections": []
            },
            {
                "name": "ACKNOWLEDGEMENTS",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENSE",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "DBI::DBD::SqlEngine - Base class for DBI drivers without their own SQL\nengine\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "package DBD::myDriver;\n\nuse base qw(DBI::DBD::SqlEngine);\n\nsub driver\n{\n...\nmy $drh = $proto->SUPER::driver($attr);\n...\nreturn $drh->{class};\n}\n\npackage DBD::myDriver::dr;\n\n@ISA = qw(DBI::DBD::SqlEngine::dr);\n\nsub datasources { ... }\n...\n\npackage DBD::myDriver::db;\n\n@ISA = qw(DBI::DBD::SqlEngine::db);\n\nsub initvalidattributes { ... }\nsub initdefaultattributes { ... }\nsub setversions { ... }\nsub validateSTOREattr { my ($dbh, $attrib, $value) = @; ... }\nsub validateFETCHattr { my ($dbh, $attrib) = @; ... }\nsub getmydversions { ... }\nsub getavailtables { ... }\n\npackage DBD::myDriver::st;\n\n@ISA = qw(DBI::DBD::SqlEngine::st);\n\nsub FETCH { ... }\nsub STORE { ... }\n\npackage DBD::myDriver::Statement;\n\n@ISA = qw(DBI::DBD::SqlEngine::Statement);\n\nsub opentable { ... }\n\npackage DBD::myDriver::Table;\n\n@ISA = qw(DBI::DBD::SqlEngine::Table);\n\nsub new { ... }\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "DBI::DBD::SqlEngine abstracts the usage of SQL engines from the DBD.\nDBD authors can concentrate on the data retrieval they want to provide.\n\nIt is strongly recommended that you read DBD::File::Developers and\nDBD::File::Roadmap, because many of the DBD::File API is provided by\nDBI::DBD::SqlEngine.\n\nCurrently the API of DBI::DBD::SqlEngine is experimental and will\nlikely change in the near future to provide the table meta data basics\nlike DBD::File.\n\nDBI::DBD::SqlEngine expects that any driver in inheritance chain has a\nDBI prefix.\n\nMetadata\nThe following attributes are handled by DBI itself and not by\nDBI::DBD::SqlEngine, thus they all work as expected:\n\nActive\nActiveKids\nCachedKids\nCompatMode             (Not used)\nInactiveDestroy\nAutoInactiveDestroy\nKids\nPrintError\nRaiseError\nWarn                   (Not used)\n\nThe following DBI attributes are handled by DBI::DBD::SqlEngine:\n\nAutoCommit\n\nAlways on.\n\nChopBlanks\n\nWorks.\n\nNUMOFFIELDS\n\nValid after \"$sth->execute\".\n\nNUMOFPARAMS\n\nValid after \"$sth->prepare\".\n\nNAME\n\nValid after \"$sth->execute\"; probably undef for Non-Select statements.\n\nNULLABLE\n\nNot really working, always returns an array ref of ones, as DBD::CSV\ndoes not verify input data. Valid after \"$sth->execute\"; undef for non-\nselect statements.\n\nThe following DBI attributes and methods are not supported:\n\nbindparaminout\nCursorName\nLongReadLen\nLongTruncOk\n\nDBI::DBD::SqlEngine specific attributes\n\nIn addition to the DBI attributes, you can use the following dbh\nattributes:\n\nsqlengineversion\n\nContains the module version of this driver (readonly)\n\nsqlnanoversion\n\nContains the module version of DBI::SQL::Nano (readonly)\n\nsqlstatementversion\n\nContains the module version of SQL::Statement, if available (readonly)\n\nsqlhandler\n\nContains the SQL Statement engine, either DBI::SQL::Nano or\nSQL::Statement (readonly).\n\nsqlparserobject\n\nContains an instantiated instance of SQL::Parser (readonly).  This is\nfilled when used first time (only when used with SQL::Statement).\n\nsqlspongedriver\n\nContains an internally used DBD::Sponge handle (readonly).\n\nsqlvalidattrs\n\nContains the list of valid attributes for each DBI::DBD::SqlEngine\nbased driver (readonly).\n\nsqlreadonlyattrs\n\nContains the list of those attributes which are readonly (readonly).\n\nsqlidentifiercase\n\nContains how DBI::DBD::SqlEngine deals with non-quoted SQL identifiers:\n\n* SQLICUPPER (1) means all identifiers are internally converted\ninto upper-cased pendants\n* SQLICLOWER (2) means all identifiers are internally converted\ninto lower-cased pendants\n* SQLICMIXED (4) means all identifiers are taken as they are\n\nThese conversions happen if (and only if) no existing identifier\nmatches.  Once existing identifier is used as known.\n\nThe SQL statement execution classes doesn't have to care, so don't\nexpect \"sqlidentifiercase\" affects column names in statements like\n\nSELECT * FROM foo\n\nsqlquotedidentifiercase\n\nContains how DBI::DBD::SqlEngine deals with quoted SQL identifiers\n(readonly). It's fixated to SQLICSENSITIVE (3), which is interpreted\nas SQLICMIXED.\n\nsqlflags\n\nContains additional flags to instantiate an SQL::Parser. Because an\nSQL::Parser is instantiated only once, it's recommended to set this\nflag before any statement is executed.\n\nsqldialect\n\nControls the dialect understood by SQL::Parser. Possible values\n(delivery state of SQL::Statement):\n\n* ANSI\n* CSV\n* AnyData\n\nDefaults to \"CSV\".  Because an SQL::Parser is instantiated only once\nand SQL::Parser doesn't allow one to modify the dialect once\ninstantiated, it's strongly recommended to set this flag before any\nstatement is executed (best place is connect attribute hash).\n\nsqlengineingofer\n\nThis value has a true value in case of this driver is operated via\nDBD::Gofer. The impact of being operated via Gofer is a read-only\ndriver (not read-only databases!), so you cannot modify any attributes\nlater - neither any table settings. But you won't get an error in cases\nyou modify table attributes, so please carefully watch\n\"sqlengineingofer\".\n\nsqlmeta\n\nPrivate data area which contains information about the tables this\nmodule handles. Table meta data might not be available until the table\nhas been accessed for the first time e.g., by issuing a select on it\nhowever it is possible to pre-initialize attributes for each table you\nuse.\n\nDBI::DBD::SqlEngine recognizes the (public) attributes \"colnames\",\n\"tablename\", \"readonly\", \"sqldatasource\" and \"sqlidentifiercase\".\nBe very careful when modifying attributes you do not know, the\nconsequence might be a destroyed or corrupted table.\n\nWhile \"sqlmeta\" is a private and readonly attribute (which means, you\ncannot modify it's values), derived drivers might provide restricted\nwrite access through another attribute. Well known accessors are\n\"csvtables\" for DBD::CSV, \"adtables\" for DBD::AnyData and\n\"dbmtables\" for DBD::DBM.\n\nsqltablesource\n\nControls the class which will be used for fetching available tables.\n\nSee \"DBI::DBD::SqlEngine::TableSource\" for details.\n\nsqldatasource\n\nContains the class name to be used for opening tables.\n\nSee \"DBI::DBD::SqlEngine::DataSource\" for details.\n\nDriver private methods\nDefault DBI methods\n\ndatasources\n\nThe \"datasources\" method returns a list of subdirectories of the\ncurrent directory in the form \"dbi:CSV:fdir=$dirname\".\n\nIf you want to read the subdirectories of another directory, use\n\nmy ($drh)  = DBI->installdriver (\"CSV\");\nmy (@list) = $drh->datasources (fdir => \"/usr/local/csvdata\");\n\nlisttables\n\nThis method returns a list of file names inside $dbh->{fdir}.\nExample:\n\nmy ($dbh)  = DBI->connect (\"dbi:CSV:fdir=/usr/local/csvdata\");\nmy (@list) = $dbh->func (\"listtables\");\n\nNote that the list includes all files contained in the directory, even\nthose that have non-valid table names, from the view of SQL.\n\nAdditional methods\n\nThe following methods are only available via their documented name when\nDBI::DBD::SQlEngine is used directly. Because this is only reasonable\nfor testing purposes, the real names must be used instead. Those names\ncan be computed by replacing the \"sql\" in the method name with the\ndriver prefix.\n\nsqlversions\n\nSignature:\n\nsub sqlversions (;$) {\nmy ($tablename) = @;\n$tablename ||= \".\";\n...\n}\n\nReturns the versions of the driver, including the DBI version, the Perl\nversion, DBI::PurePerl version (if DBI::PurePerl is active) and the\nversion of the SQL engine in use.\n\nmy $dbh = DBI->connect (\"dbi:File:\");\nmy $sqlversions = $dbh->func( \"sqlversions\" );\nprint \"$sqlversions\\n\";\nEND\n# DBI::DBD::SqlEngine  0.05 using SQL::Statement 1.402\n# DBI                  1.623\n# OS                   netbsd (6.99.12)\n# Perl                 5.016002 (x8664-netbsd-thread-multi)\n\nCalled in list context, sqlversions will return an array containing\neach line as single entry.\n\nSome drivers might use the optional (table name) argument and modify\nversion information related to the table (e.g. DBD::DBM provides\nstorage backend information for the requested table, when it has a\ntable name).\n\nsqlgetmeta\n\nSignature:\n\nsub sqlgetmeta ($$)\n{\nmy ($tablename, $attrib) = @;\n...\n}\n\nReturns the value of a meta attribute set for a specific table, if any.\nSee sqlmeta for the possible attributes.\n\nA table name of \".\" (single dot) is interpreted as the default table.\nThis will retrieve the appropriate attribute globally from the dbh.\nThis has the same restrictions as \"$dbh->{$attrib}\".\n\nsqlsetmeta\n\nSignature:\n\nsub sqlsetmeta ($$$)\n{\nmy ($tablename, $attrib, $value) = @;\n...\n}\n\nSets the value of a meta attribute set for a specific table.  See\nsqlmeta for the possible attributes.\n\nA table name of \".\" (single dot) is interpreted as the default table\nwhich will set the specified attribute globally for the dbh.  This has\nthe same restrictions as \"$dbh->{$attrib} = $value\".\n\nsqlclearmeta\n\nSignature:\n\nsub sqlclearmeta ($)\n{\nmy ($tablename) = @;\n...\n}\n\nClears the table specific meta information in the private storage of\nthe dbh.\n\nExtensibility\nDBI::DBD::SqlEngine::TableSource\n\nProvides data sources and table information on database driver and\ndatabase handle level.\n\npackage DBI::DBD::SqlEngine::TableSource;\n\nsub datasources ($;$)\n{\nmy ( $class, $drh, $attrs ) = @;\n...\n}\n\nsub availtables\n{\nmy ( $class, $drh ) = @;\n...\n}\n\nThe \"datasources\" method is called when the user invokes any of the\nfollowing:\n\n@ary = DBI->datasources($driver);\n@ary = DBI->datasources($driver, \\%attr);\n\n@ary = $dbh->datasources();\n@ary = $dbh->datasources(\\%attr);\n\nThe \"availtables\" method is called when the user invokes any of the\nfollowing:\n\n@names = $dbh->tables( $catalog, $schema, $table, $type );\n\n$sth = $dbh->tableinfo( $catalog, $schema, $table, $type );\n$sth = $dbh->tableinfo( $catalog, $schema, $table, $type, \\%attr );\n\n$dbh->func( \"listtables\" );\n\nEvery time where an \"\\%attr\" argument can be specified, this \"\\%attr\"\nobject's \"sqltablesource\" attribute is preferred over the $dbh\nattribute or the driver default, eg.\n\n@ary = DBI->datasources(\"dbi:CSV:\", {\nfdir => \"/your/csv/tables\",\n# note: this class doesn't comes with DBI\nsqltablesource => \"DBD::File::Archive::Tar::TableSource\",\n# scan tarballs instead of directories\n});\n\nWhen you're going to implement such a\nDBD::File::Archive::Tar::TableSource class, remember to add correct\nattributes (including \"sqltablesource\" and \"sqldatasource\") to the\nreturned DSN's.\n\nDBI::DBD::SqlEngine::DataSource\n\nProvides base functionality for dealing with tables. It is primarily\ndesigned for allowing transparent access to files on disk or already\nopened (file-)streams (eg. for DBD::CSV).\n\nDerived classes shall be restricted to similar functionality, too (eg.\nopening streams from an archive, transparently compress/uncompress log\nfiles before parsing them,\n\npackage DBI::DBD::SqlEngine::DataSource;\n\nsub completetablename ($$;$)\n{\nmy ( $self, $meta, $table, $respectcase ) = @;\n...\n}\n\nThe method \"completetablename\" is called when first setting up the\nmeta information for a table:\n\n\"SELECT user.id, user.name, user.shell FROM user WHERE ...\"\n\nresults in opening the table \"user\". First step of the table open\nprocess is completing the name. Let's imagine you're having a DBD::CSV\nhandle with following settings:\n\n$dbh->{sqlidentifiercase} = SQLICLOWER;\n$dbh->{fext} = '.lst';\n$dbh->{fdir} = '/data/web/adrmgr';\n\nThose settings will result in looking for files matching\n\"[Uu][Ss][Ee][Rr](\\.lst)?$\" in \"/data/web/adrmgr/\". The scanning of the\ndirectory \"/data/web/adrmgr/\" and the pattern match check will be done\nin \"DBD::File::DataSource::File\" by the \"completetablename\" method.\n\nIf you intend to provide other sources of data streams than files, in\naddition to provide an appropriate \"completetablename\" method, a\nmethod to open the resource is required:\n\npackage DBI::DBD::SqlEngine::DataSource;\n\nsub opendata ($)\n{\nmy ( $self, $meta, $attrs, $flags ) = @;\n...\n}\n\nAfter the method \"opendata\" has been run successfully, the table's\nmeta information are in a state which allowes the table's data accessor\nmethods will be able to fetch/store row information. Implementation\ndetails heavily depends on the table implementation, whereby the most\nfamous is surely DBD::File::Table.\n",
                "subsections": []
            },
            "SQL ENGINES": {
                "content": "DBI::DBD::SqlEngine currently supports two SQL engines: SQL::Statement\nand DBI::SQL::Nano::Statement. DBI::SQL::Nano supports a very limited\nsubset of SQL statements, but it might be faster for some very simple\ntasks. SQL::Statement in contrast supports a much larger subset of ANSI\nSQL.\n\nTo use SQL::Statement, you need at least version 1.401 of\nSQL::Statement and the environment variable \"DBISQLNANO\" must not be\nset to a true value.\n",
                "subsections": []
            },
            "SUPPORT": {
                "content": "You can find documentation for this module with the perldoc command.\n\nperldoc DBI::DBD::SqlEngine\n\nYou can also look for information at:\n\no   RT: CPAN's request tracker\n\n<http://rt.cpan.org/NoAuth/Bugs.html?Dist=DBI>\n<http://rt.cpan.org/NoAuth/Bugs.html?Dist=SQL-Statement>\n\no   AnnoCPAN: Annotated CPAN documentation\n\n<http://annocpan.org/dist/DBI>\n<http://annocpan.org/dist/SQL-Statement>\n\no   CPAN Ratings\n\n<http://cpanratings.perl.org/d/DBI>\n\no   Search CPAN\n\n<http://search.cpan.org/dist/DBI/>\n\nWhere can I go for more help?\nFor questions about installation or usage, please ask on the\ndbi-dev@perl.org mailing list.\n\nIf you have a bug report, patch or suggestion, please open a new report\nticket on CPAN, if there is not already one for the issue you want to\nreport. Of course, you can mail any of the module maintainers, but it\nis less likely to be missed if it is reported on RT.\n\nReport tickets should contain a detailed description of the bug or\nenhancement request you want to report and at least an easy way to\nverify/reproduce the issue and any supplied fix. Patches are always\nwelcome, too.\n",
                "subsections": []
            },
            "ACKNOWLEDGEMENTS": {
                "content": "Thanks to Tim Bunce, Martin Evans and H.Merijn Brand for their\ncontinued support while developing DBD::File, DBD::DBM and\nDBD::AnyData.  Their support, hints and feedback helped to design and\nimplement this module.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "This module is currently maintained by\n\nH.Merijn Brand < h.m.brand at xs4all.nl > and Jens Rehsack  < rehsack\nat googlemail.com >\n\nThe original authors are Jochen Wiedmann and Jeff Zucker.\n",
                "subsections": []
            },
            "COPYRIGHT AND LICENSE": {
                "content": "Copyright (C) 2009-2013 by H.Merijn Brand & Jens Rehsack\nCopyright (C) 2004-2009 by Jeff Zucker\nCopyright (C) 1998-2004 by Jochen Wiedmann\n\nAll rights reserved.\n\nYou may freely distribute and/or modify this module under the terms of\neither the GNU General Public License (GPL) or the Artistic License, as\nspecified in the Perl README file.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "DBI, DBD::File, DBD::AnyData and DBD::Sys.\n\nperl v5.34.0                      2026-06-22          DBI::DBD::SqlEngine(3pm)",
                "subsections": []
            }
        }
    }
}