INN::ovsqlite_client Perl module to manipulate an ovsqlite database
Julien ÉLIE
julien at trigofacile.com
Sat Dec 23 12:28:45 UTC 2023
Hi all,
This message to make you aware of an INN::ovsqlite_client Perl module
written by Bo Lindbergh. I believe it will be of interest to people in
this list.
This module permits accessing an ovsqlite overview database through
ovsqlite-server from a Perl script. It provides the same functions as
INN internally uses to search, add, remove and expire information stored
in an ovsqlite database (newsgroups and overview data associated to
articles in these newsgroups).
Two samples are also provided in the contrib directory (ovsqlite-dump
and ovsqlite-undump) to show how to use the module.
Many thanks to Bo for this great and impressive contribution!
https://raw.githubusercontent.com/InterNetNews/inn/main/perl/INN/ovsqlite_client.pm
https://raw.githubusercontent.com/InterNetNews/inn/main/contrib/ovsqlite-dump.in
https://raw.githubusercontent.com/InterNetNews/inn/main/contrib/ovsqlite-undump.in
Example from the documentation to retrieve the overview data of all the
articles in news.software.nntp:
use INN::ovsqlite_client qw(:all);
my $client
= INN::ovsqlite_client::->new(
port => "/usr/local/news/run/ovsqlite.sock");
$client->search_group(
groupname => "news.software.nntp",
low => 1,
cols => search_col_overview,
articles => my $articles,
errmsg => my $errmsg
);
defined($errmsg)
and die "search_group: $errmsg";
foreach my $article (@{$articles}) {
print $article->{overview};
}
Besides search_group(), are also add_group(), get_groupinfo(),
delete_group(), list_groups(), add_article(), get_artinfo(),
delete_article(), search_group(), expire_group()...
They will surely be helpful for custom scripts fitting your needs :)
--
Julien ÉLIE
« Une robe de femme doit être comme une plaidoirie : assez longue pour
couvrir le sujet, assez courte pour être suivie. »
More information about the inn-workers
mailing list