NAME
App::rimetadb - Manage a Rinci metadata database
VERSION
This document describes version 0.226 of App::rimetadb (from Perl
distribution App-rimetadb), released on 2023-07-09.
SYNOPSIS
See the included CLI script rimetadb.
FUNCTIONS
argument_stats
Usage:
argument_stats(%args) -> [$status_code, $reason, $payload, \%result_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.
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_code) is an integer containing HTTP-like status
code (200 means OK, 4xx caller error, 5xx function error). Second
element ($reason) is a string containing error message, or something
like "OK" if status is 200. Third element ($payload) is the actual
result, but usually not present when enveloped result is an error
response ($status_code is not 2xx). Fourth element (%result_meta) is
called result metadata and is optional, a hash that contains extra
information, much like how HTTP response headers provide additional
metadata.
Return value: (any)
arguments
Usage:
arguments(%args) -> [$status_code, $reason, $payload, \%result_meta]
List function arguments in the database.
This function is not exported.
Arguments ('*' denotes required arguments):
* detail => *bool*
(No description)
* dsn => *str*
DBI connection DSN.
If not specified, will default to "dbd:SQLite:$HOME/rimeta.db" where
$HOME is user's home directory.
Note: has been tested with MySQL and SQLite only.
* function => *str*
Select specific function only.
* package => *perl::modname*
Select specific package only.
* password => *str*
DBI connection password.
* query => *str*
(No description)
* type => *str*
Select arguments with specific type only.
* user => *str*
DBI connection user.
Returns an enveloped result (an array).
First element ($status_code) is an integer containing HTTP-like status
code (200 means OK, 4xx caller error, 5xx function error). Second
element ($reason) is a string containing error message, or something
like "OK" if status is 200. Third element ($payload) is the actual
result, but usually not present when enveloped result is an error
response ($status_code is not 2xx). Fourth element (%result_meta) is
called result metadata and is optional, a hash that contains extra
information, much like how HTTP response headers provide additional
metadata.
Return value: (any)
delete
Usage:
delete(%args) -> [$status_code, $reason, $payload, \%result_meta]
Delete a package or function metadata 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.
Note: has been tested with MySQL and SQLite only.
* function => *str*
(No description)
* package* => *perl::modname*
(No description)
* password => *str*
DBI connection password.
* user => *str*
DBI connection user.
Returns an enveloped result (an array).
First element ($status_code) is an integer containing HTTP-like status
code (200 means OK, 4xx caller error, 5xx function error). Second
element ($reason) is a string containing error message, or something
like "OK" if status is 200. Third element ($payload) is the actual
result, but usually not present when enveloped result is an error
response ($status_code is not 2xx). Fourth element (%result_meta) is
called result metadata and is optional, a hash that contains extra
information, much like how HTTP response headers provide additional
metadata.
Return value: (any)
function_stats
Usage:
function_stats(%args) -> [$status_code, $reason, $payload, \%result_meta]
Show some statistics on functions 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.
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_code) is an integer containing HTTP-like status
code (200 means OK, 4xx caller error, 5xx function error). Second
element ($reason) is a string containing error message, or something
like "OK" if status is 200. Third element ($payload) is the actual
result, but usually not present when enveloped result is an error
response ($status_code is not 2xx). Fourth element (%result_meta) is
called result metadata and is optional, a hash that contains extra
information, much like how HTTP response headers provide additional
metadata.
Return value: (any)
functions
Usage:
functions(%args) -> [$status_code, $reason, $payload, \%result_meta]
List functions in the database.
This function is not exported.
Arguments ('*' denotes required arguments):
* detail => *bool*
(No description)
* dsn => *str*
DBI connection DSN.
If not specified, will default to "dbd:SQLite:$HOME/rimeta.db" where
$HOME is user's home directory.
Note: has been tested with MySQL and SQLite only.
* package => *perl::modname*
Select specific package only.
* password => *str*
DBI connection password.
* query => *str*
(No description)
* user => *str*
DBI connection user.
Returns an enveloped result (an array).
First element ($status_code) is an integer containing HTTP-like status
code (200 means OK, 4xx caller error, 5xx function error). Second
element ($reason) is a string containing error message, or something
like "OK" if status is 200. Third element ($payload) is the actual
result, but usually not present when enveloped result is an error
response ($status_code is not 2xx). Fourth element (%result_meta) is
called result metadata and is optional, a hash that contains extra
information, much like how HTTP response headers provide additional
metadata.
Return value: (any)
meta
Usage:
meta(%args) -> [$status_code, $reason, $payload, \%result_meta]
Get package/function metadata 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.
Note: has been tested with MySQL and SQLite only.
* name* => *perl::modname*
(Fully-qualified) function name or package name.
* password => *str*
DBI connection password.
* user => *str*
DBI connection user.
Returns an enveloped result (an array).
First element ($status_code) is an integer containing HTTP-like status
code (200 means OK, 4xx caller error, 5xx function error). Second
element ($reason) is a string containing error message, or something
like "OK" if status is 200. Third element ($payload) is the actual
result, but usually not present when enveloped result is an error
response ($status_code is not 2xx). Fourth element (%result_meta) is
called result metadata and is optional, a hash that contains extra
information, much like how HTTP response headers provide additional
metadata.
Return value: (any)
packages
Usage:
packages(%args) -> [$status_code, $reason, $payload, \%result_meta]
List packages in the database.
This function is not exported.
Arguments ('*' denotes required arguments):
* detail => *bool*
(No description)
* dsn => *str*
DBI connection DSN.
If not specified, will default to "dbd:SQLite:$HOME/rimeta.db" where
$HOME is user's home directory.
Note: has been tested with MySQL and SQLite only.
* password => *str*
DBI connection password.
* query => *str*
(No description)
* user => *str*
DBI connection user.
Returns an enveloped result (an array).
First element ($status_code) is an integer containing HTTP-like status
code (200 means OK, 4xx caller error, 5xx function error). Second
element ($reason) is a string containing error message, or something
like "OK" if status is 200. Third element ($payload) is the actual
result, but usually not present when enveloped result is an error
response ($status_code is not 2xx). Fourth element (%result_meta) is
called result metadata and is optional, a hash that contains extra
information, much like how HTTP response headers provide additional
metadata.
Return value: (any)
stats
Usage:
stats(%args) -> [$status_code, $reason, $payload, \%result_meta]
Show some statistics 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.
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_code) is an integer containing HTTP-like status
code (200 means OK, 4xx caller error, 5xx function error). Second
element ($reason) is a string containing error message, or something
like "OK" if status is 200. Third element ($payload) is the actual
result, but usually not present when enveloped result is an error
response ($status_code is not 2xx). Fourth element (%result_meta) is
called result metadata and is optional, a hash that contains extra
information, much like how HTTP response headers provide additional
metadata.
Return value: (any)
update
Usage:
update(%args) -> [$status_code, $reason, $payload, \%result_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.
This function is not exported.
Arguments ('*' denotes required arguments):
* dist => *str*
(No description)
* dsn => *str*
DBI connection DSN.
If not specified, will default to "dbd:SQLite:$HOME/rimeta.db" where
$HOME is user's home directory.
Note: has been tested with MySQL and SQLite only.
* extra => *str*
(No description)
* function => *str*
(No description)
* metadata* => *hash*
(No description)
* package* => *perl::modname*
(No description)
* password => *str*
DBI connection password.
* user => *str*
DBI connection user.
Returns an enveloped result (an array).
First element ($status_code) is an integer containing HTTP-like status
code (200 means OK, 4xx caller error, 5xx function error). Second
element ($reason) is a string containing error message, or something
like "OK" if status is 200. Third element ($payload) is the actual
result, but usually not present when enveloped result is an error
response ($status_code is not 2xx). Fourth element (%result_meta) is
called result metadata and is optional, a hash that contains extra
information, much like how HTTP response headers provide additional
metadata.
Return value: (any)
update_from_modules
Usage:
update_from_modules(%args) -> [$status_code, $reason, $payload, \%result_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 is not exported.
This function supports dry-run operation.
Arguments ('*' denotes required arguments):
* delete => *bool* (default: 1)
Whether to delete packages from DB if no longer mentioned as
arguments or found in filesystem.
* dsn => *str*
DBI connection DSN.
If not specified, will default to "dbd:SQLite:$HOME/rimeta.db" where
$HOME is user's home directory.
Note: has been tested with MySQL and SQLite only.
* exclude => *array[perl::modname_or_prefix]*
Perl package names or prefixes to exclude.
You can also use this attribute in your package metadata:
'x.app.rimetadb.exclude' => 1,
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.
* 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.
* 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.
* 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).
* a package prefix using "+Foo::Bar::" or "+Foo::Bar::" syntax.
Subpackages will be listed recursively (using
Package::Util::Lite's "list_subpackages").
* password => *str*
DBI connection password.
* 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.
* user => *str*
DBI connection user.
Special arguments:
* -dry_run => *bool*
Pass -dry_run=>1 to enable simulation mode.
Returns an enveloped result (an array).
First element ($status_code) is an integer containing HTTP-like status
code (200 means OK, 4xx caller error, 5xx function error). Second
element ($reason) is a string containing error message, or something
like "OK" if status is 200. Third element ($payload) is the actual
result, but usually not present when enveloped result is an error
response ($status_code is not 2xx). Fourth element (%result_meta) is
called result metadata and is optional, a hash that contains extra
information, much like how HTTP response headers provide additional
metadata.
Return value: (any)
HOMEPAGE
Please visit the project's homepage at
<https://metacpan.org/release/App-rimetadb>.
SOURCE
Source repository is at
<https://github.com/perlancar/perl-App-rimetadb>.
SEE ALSO
Rinci
AUTHOR
perlancar <perlancar@cpan.org>
CONTRIBUTOR
Steven Haryanto <stevenharyanto@gmail.com>
CONTRIBUTING
To contribute, you can send patches by email/via RT, or send pull
requests on GitHub.
Most of the time, you don't need to build the distribution yourself. You
can simply modify the code, then test via:
% prove -l
If you want to build the distribution (e.g. to try to install it locally
on your system), you can install Dist::Zilla,
Dist::Zilla::PluginBundle::Author::PERLANCAR,
Pod::Weaver::PluginBundle::Author::PERLANCAR, and sometimes one or two
other Dist::Zilla- and/or Pod::Weaver plugins. Any additional steps
required beyond that are considered a bug and can be reported to me.
COPYRIGHT AND LICENSE
This software is copyright (c) 2023, 2020, 2019, 2017, 2016, 2015, 2014
by perlancar <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.
BUGS
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.