Welcome to DBProc’s documentation!

Example

Firstly, we can declare a PL/pgSQL stored procedure as follows:

CREATE OR REPLACE FUNCTION test_dbproc_add(a INTEGER, b INTEGER)
    RETURNS INTEGER AS $$
BEGIN
    RETURN $1 + $2;
END;
$$ LANGUAGE 'plpgsql';

Now, using dbproc.Wrap, we can access this stored procedure in Python like:

>>> import psycopg2
>>> from dbproc import DBProc
>>> conn = psycopg2.connect('dbname=test')
>>> proc = DBProc(conn, prefix='test_dbproc_')
>>> print proc.add(23, 42)
65

Bugs/Features

You can issue a ticket in GitHub: https://github.com/tehmaze/dbproc

API

Indices and tables