perl-Plack-App-dbi2http - Export DBI database as HTTP API (Riap::HTTP)

Property Value
Distribution ALT Linux Sisyphus
Repository Autoimports noarch
Package name perl-Plack-App-dbi2http
Package version 0.07
Package release alt1
Package architecture noarch
Package type rpm
Installed size 42.39 KB
Download size 42.39 KB
Official Mirror
This module provides a sample Plack application, which you can customize, to
export a DBI database as a HTTP API service.
I was reading Yanick's blog entry today,, titled *Instant REST API for Any
Databases* and I thought I'd quickly cobble up something similar using a
different toolbox. Granted, the resulting HTTP API is not REST (read: it's
better :-) and at 0.01 the API functions are somewhat limited
(the DBIx::FunctionalAPI manpage) but this demonstrates how easy it is to create
something usable.
The tools and frameworks are: the DBIx::FunctionalAPI manpage which provides a set of
functions: `list_tables', `list_columns', `list_rows', `create_table',
`create_row', `rename_table', etc. These are normal Perl functions that accept
`dbh', `table' arguments and so on.
Next we have the Perinci::Access::HTTP::Server manpage, a set of the Plack manpage middlewares
that let you access Perl functions over HTTP using the the Riap::HTTP manpage protocol.
We compose the middlewares in a PSGI application called `dbi2http.psgi'.
All you need to do now is just run the PSGI application with the Plack manpage, using one
of the many available PSGI servers. There is a configuration file required, to
be put in the home directory, and can be copied from the provided sample config.
All you need to set is basically just path to log file and the DBI connection
information (db_dsn, db_user, db_password) and you're good to go.
After the PSGI application is running, you can connect using a plain HTTP client
like curl. Riap::HTTP exposes Perl modules and functions directly as URL
paths. For example, you can just request the root URL first, and a help message
is returned:
% curl http://localhost:5000/
function        list_columns
function        list_rows
function        list_tables
* To call a function, try:
* Function arguments can be given via GET/POST params or JSON hash in req body
* To find out which arguments a function supp...


Package Version Architecture Repository
perl-Plack-App-dbi2http - - -


Name Value
/usr/share/perl5 -
perl-base >= 1:5.10.1
rpmlib(PayloadIsLzma) -


Name Value
perl(Plack/App/ = 0.070
perl-Plack-App-dbi2http = 0.07-alt1


Type URL
Binary Package perl-Plack-App-dbi2http-0.07-alt1.noarch.rpm
Source Package perl-Plack-App-dbi2http-0.07-alt1.src.rpm

Install Howto

  1. Add the following line to /etc/apt/sources.list:
    rpm [Sisyphus] noarch autoimports
    rpm [Sisyphus] noarch autoimports
  2. Update the package index:
    # sudo apt-get update
  3. Install perl-Plack-App-dbi2http rpm package:
    # sudo apt-get install perl-Plack-App-dbi2http



See Also

Package Description
perl-Plack-App-dbi2http-scripts-0.07-alt1.noarch.rpm Plack-App-dbi2http scripts
perl-Plack-App-unAPI-0.61-alt1.noarch.rpm Serve via unAPI
perl-Plack-Auth-SSO-0.0136-alt1.noarch.rpm role for Single Sign On (SSO) authentication
perl-Plack-Builder-Conditionals-0.05-alt1.noarch.rpm Plack::Builder extension
perl-Plack-Client-0.06-alt1.noarch.rpm abstract interface to remote web servers and local PSGI apps
perl-Plack-Debugger-0.03-alt1.noarch.rpm Debugging tool for Plack web applications
perl-Plack-Debugger-Panel-DBIC-QueryLog-0.002-alt1.noarch.rpm DBIC query log panel for Plack::Debugger
perl-Plack-Debugger-Panel-DBIProfile-0.01-alt1.noarch.rpm A DBI::Profile panel for Plack::Debugger
perl-Plack-Debugger-Panel-Dancer2-Version-0.001-alt1.noarch.rpm Plack Debugger Panel for displaying Dancer2 Version
perl-Plack-Handler-AnyEvent-FCGI-0.01-alt1.noarch.rpm Asynchronous FCGI handler for PSGI using AnyEvent::FCGI
perl-Plack-Handler-AnyEvent-HTTPD-0.03-alt1.noarch.rpm Plack handler to run PSGI apps on AnyEvent::HTTPD
perl-Plack-Handler-AnyEvent-ReverseHTTP-0.04-alt1.noarch.rpm reversehttp gateway for PSGI application
perl-Plack-Handler-AnyEvent-SCGI-0.03-alt1.noarch.rpm PSGI handler on AnyEvent::SCGI
perl-Plack-Handler-CLI-0.05-alt1.noarch.rpm Command line interface to PSGI applications
perl-Plack-Handler-FCGI-EV-0.01-alt1.noarch.rpm PSGI handler for FCGI::EV