Metadata-Version: 2.1
Name: dbutils3-gonzalo123
Version: 3.0.1
Summary: psycopg3 db utils
Home-page: https://github.com/gonzalo123/dbutils3
Author: Gonzalo Ayuso
Author-email: gonzalo123@gmail.com
License: MIT
Keywords: psycopg3
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.5
Description-Content-Type: text/markdown
License-File: LICENSE

# Database utils for psycopg3

[dbutils](https://github.com/gonzalo123/dbutils)

## Install

```commandline
pip install dbutils3-gonzalo123
```

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

### Run test
```commandline
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.

```ini
[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:

```sql
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;
```


