{
    "content": [
        {
            "type": "text",
            "text": "# DBD::SQLite::VirtualTable::FileContent (perldoc)\n\n## NAME\n\nDBD::SQLite::VirtualTable::FileContent -- virtual table for viewing file contents\n\n## SYNOPSIS\n\nWithin Perl :\n$dbh->sqlitecreatemodule(fcontent => \"DBD::SQLite::VirtualTable::FileContent\");\nThen, within SQL :\nCREATE VIRTUAL TABLE tbl USING fcontent(\nsource      = srctable,\ncontentcol = content,\npathcol    = path,\nexpose      = \"path, col1, col2, col3\", -- or \"*\"\nroot        = \"/foo/bar\"\ngetcontent = Foo::Bar::readfromfile\n);\nSELECT col1, path, content FROM tbl WHERE ...;\n\n## DESCRIPTION\n\nA \"FileContent\" virtual table is bound to some underlying *source table*, which has a column\ncontaining paths to files. The virtual table behaves like a database view on the source table,\nwith an added column which exposes the content from those files.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **PARAMETERS**\n- **AUTHOR**\n- **COPYRIGHT AND LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "DBD::SQLite::VirtualTable::FileContent",
        "section": "",
        "mode": "perldoc",
        "summary": "DBD::SQLite::VirtualTable::FileContent -- virtual table for viewing file contents",
        "synopsis": "Within Perl :\n$dbh->sqlitecreatemodule(fcontent => \"DBD::SQLite::VirtualTable::FileContent\");\nThen, within SQL :\nCREATE VIRTUAL TABLE tbl USING fcontent(\nsource      = srctable,\ncontentcol = content,\npathcol    = path,\nexpose      = \"path, col1, col2, col3\", -- or \"*\"\nroot        = \"/foo/bar\"\ngetcontent = Foo::Bar::readfromfile\n);\nSELECT col1, path, content FROM tbl WHERE ...;",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 17,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "PARAMETERS",
                "lines": 29,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENSE",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "DBD::SQLite::VirtualTable::FileContent -- virtual table for viewing file contents\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "Within Perl :\n\n$dbh->sqlitecreatemodule(fcontent => \"DBD::SQLite::VirtualTable::FileContent\");\n\nThen, within SQL :\n\nCREATE VIRTUAL TABLE tbl USING fcontent(\nsource      = srctable,\ncontentcol = content,\npathcol    = path,\nexpose      = \"path, col1, col2, col3\", -- or \"*\"\nroot        = \"/foo/bar\"\ngetcontent = Foo::Bar::readfromfile\n);\n\nSELECT col1, path, content FROM tbl WHERE ...;\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "A \"FileContent\" virtual table is bound to some underlying *source table*, which has a column\ncontaining paths to files. The virtual table behaves like a database view on the source table,\nwith an added column which exposes the content from those files.\n\nThis is especially useful as an \"external content\" to some fulltext table (see\nDBD::SQLite::Fulltextsearch) : the index table stores some metadata about files, and then the\nfulltext engine can index both the metadata and the file contents.\n",
                "subsections": []
            },
            "PARAMETERS": {
                "content": "Parameters for creating a \"FileContent\" virtual table are specified within the \"CREATE VIRTUAL\nTABLE\" statement, just like regular column declarations, but with an '=' sign. Authorized\nparameters are :\n\n\"source\"\nThe name of the *source table*. This parameter is mandatory. All other parameters are\noptional.\n\n\"contentcol\"\nThe name of the virtual column exposing file contents. The default is \"content\".\n\n\"pathcol\"\nThe name of the column in \"source\" that contains paths to files. The default is \"path\".\n\n\"expose\"\nA comma-separated list (within double quotes) of source column names to be exposed by the\nvirtual table. The default is \"*\", which means all source columns.\n\n\"root\"\nAn optional root directory that will be prepended to the *path* column when opening files.\n\n\"getcontent\"\nFully qualified name of a Perl function for reading file contents. The default\nimplementation just slurps the entire file into a string; but this hook can point to more\nsophisticated implementations, like for example a function that would remove html tags. The\nhooked function is called like this :\n\n$filecontent = $getcontent->($path, $root);\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Laurent Dami <dami@cpan.org>\n",
                "subsections": []
            },
            "COPYRIGHT AND LICENSE": {
                "content": "Copyright Laurent Dami, 2014.\n\nThis library is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
                "subsections": []
            }
        }
    }
}