Skip to main content

psycopg2 db utils

Project description

Database utils for psycopg2

dbutils

Install

pip install dbutils-gonzalo123

From github

pip install -e git+https://github.com/gonzalo123/dbutils#egg=dbutils-gonzalo123

Run test

pytest

Note: Set up your connection parameters within pytest.ini. I also provide one docker-compose.yml file with a PostgreSQL database ready for the testing.

[pytest]
python_files = tests.py test_*.py *_tests.py
env =
    POSTGRES_HOST=localhost
    POSTGRES_PASSWORD=password
    POSTGRES_USER=username
    POSTGRES_DB=gonzalo123

In this database ther's one table and one stored procedure:

CREATE TABLE users
(
    email  VARCHAR(256) UNIQUE NOT NULL,
    "name" VARCHAR(256)        NOT NULL
);

CREATE OR REPLACE FUNCTION hello(name varchar(100))
    RETURNS VARCHAR AS
$$
BEGIN
    RETURN 'Hello ' || name;

END;
$$
    LANGUAGE plpgsql;

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbutils-gonzalo123-1.3.11.tar.gz (5.6 kB view hashes)

Uploaded Source

Built Distribution

dbutils_gonzalo123-1.3.11-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page