App::rimetadb - Manage a Rinci metadata database
This document describes version 0.225 of App::rimetadb (from Perl distribution App-rimetadb), released on 2020-04-08.
See the included CLI script rimetadb.
Usage:
argument_stats(%args) -> [status, msg, payload, meta]
Show statistics on function arguments from the database.
This function is not exported.
Arguments ('*' denotes required arguments):
dsn => str
DBI connection DSN.
If not specified, will default to dbd:SQLite:$HOME/rimeta.db where $HOME is user's home directory.
dbd:SQLite:$HOME/rimeta.db
$HOME
Note: has been tested with MySQL and SQLite only.
password => str
DBI connection password.
user => str
DBI connection user.
Returns an enveloped result (an array).
First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (payload) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.
Return value: (any)
arguments(%args) -> [status, msg, payload, meta]
List function arguments in the database.
detail => bool
function => str
Select specific function only.
package => perl::modname
Select specific package only.
query => str
type => str
Select arguments with specific type only.
delete(%args) -> [status, msg, payload, meta]
Delete a package or function metadata from the database.
package* => perl::modname
function_stats(%args) -> [status, msg, payload, meta]
Show some statistics on functions from the database.
functions(%args) -> [status, msg, payload, meta]
List functions in the database.
meta(%args) -> [status, msg, payload, meta]
Get package/function metadata from the database.
name* => perl::modname
(Fully-qualified) function name or package name.
packages(%args) -> [status, msg, payload, meta]
List packages in the database.
stats(%args) -> [status, msg, payload, meta]
Show some statistics from the database.
update(%args) -> [status, msg, payload, meta]
Add/update a package or function metadata in the database.
This routine lets you add/update a package or function metadata in the database with the specified metadata.
dist => str
extra => str
metadata* => hash
update_from_modules(%args) -> [status, msg, payload, meta]
Update Rinci metadata database from local Perl modules.
This routine scans Perl modules, load them, and update the database using Rinci metadata from each modules into the database.
For each package, function, or function argument metadata, you can put this attribute:
'x.app.rimetadb.exclude' => 1,
to exclude the entity from being imported into the database. When you exclude a package, all its contents (currently functions) are also excluded.
This function supports dry-run operation.
delete => bool (default: 1)
Whether to delete packages from DB if no longer mentioned as arguments or found in filesystem.
exclude => array[perl::modname_or_prefix]
Perl package names or prefixes to exclude.
You can also use this attribute in your package metadata:
to exclude the package (as well as its contents: all functions) from being imported into the database.
force_update => bool
Force update database even though module hasn't changed since last update.
library => dirname
Include library path, like Perl's -I.
Note that some modules are already loaded before this option takes effect. To make sure you use the right library, you can use PERL5OPT or explicitly use perl and use its -I option.
PERL5OPT
perl
-I
module_or_package* => array[perl::modname_or_prefix]
Perl module or prefixes or package to add/update.
For each entry, you can specify:
a Perl module name e.g. Foo::Bar. An attempt will be made to load that module.
Foo::Bar
a module prefix ending with :: e.g. Foo::Bar::. Module::List will be used to list all modules under Foo::Bar:: recursively and load all those modules.
::
Foo::Bar::
Module::List
a package name using +Foo::Bar syntax. An attempt to load module with that name will not be made. This can be used to add an already-loaded package e.g. by another module).
+Foo::Bar
a package prefix using +Foo::Bar:: or +Foo::Bar:: syntax. Subpackages will be listed recursively (using Package::Util::Lite's list_subpackages).
+Foo::Bar::
list_subpackages
require => array[perl::modname]
Require a Perl module, a la Perl's -m.
use => array[perl::modname]
Use a Perl module, a la Perl's -M.
Special arguments:
-dry_run => bool
Pass -dry_run=>1 to enable simulation mode.
Please visit the project's homepage at https://metacpan.org/release/App-rimetadb.
Source repository is at https://github.com/perlancar/perl-App-rimetadb.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=App-rimetadb
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
Rinci
perlancar <perlancar@cpan.org>
This software is copyright (c) 2020, 2019, 2017, 2016, 2015, 2014 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install App::rimetadb, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::rimetadb
CPAN shell
perl -MCPAN -e shell install App::rimetadb
For more information on module installation, please visit the detailed CPAN module installation guide.