Skip to content

Commit b809f92

Browse files
authored
update PG (#18)
1 parent 5d46522 commit b809f92

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Aloha!
22

33
[![License](https://img.shields.io/github/license/QPod/aloha)](https://github.com/QPod/aloha/blob/main/LICENSE)
4-
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/QPod/aloha/build)](https://github.com/QPod/aloha/actions)
4+
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/QPod/aloha-python/pip.yml?branch=main)](https://github.com/QPod/aloha-python/actions)
55
[![Join the Gitter Chat](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/QPod/)
66
[![PyPI version](https://img.shields.io/pypi/v/aloha)](https://pypi.python.org/pypi/aloha/)
77
[![PyPI Downloads](https://img.shields.io/pypi/dm/aloha)](https://pepy.tech/badge/aloha/)
@@ -21,6 +21,6 @@ Please generously STAR★ our project or donate to us! [![GitHub Starts](https:
2121

2222
## Getting started
2323

24-
```py
24+
```shell
2525
pip install aloha[all]
2626
```

src/aloha/db/postgres.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
__all__ = ('PostgresOperator',)
22

3-
import psycopg2
3+
import psycopg
44
from sqlalchemy import create_engine
55
from sqlalchemy.sql import text
66

77
from .base import PasswordVault
88
from ..logger import LOG
99

10-
LOG.debug('postgres: psycopg2 version = %s' % psycopg2.__version__)
10+
LOG.debug('postgres: psycopg2 version = %s' % psycopg.__version__)
1111

1212

1313
class PostgresOperator:
@@ -26,8 +26,8 @@ def __init__(self, db_config, **kwargs):
2626

2727
try:
2828
self.engine = create_engine(
29-
'postgresql+psycopg2://{user}:{password}@{host}:{port}/{dbname}'.format(**self._config),
30-
connect_args=connect_args, client_encoding='utf8', encoding='utf-8',
29+
'postgresql+psycopg://{user}:{password}@{host}:{port}/{dbname}'.format(**self._config),
30+
connect_args=connect_args, client_encoding='utf8',
3131
pool_size=20, max_overflow=10, pool_pre_ping=True, **kwargs
3232
)
3333
LOG.debug("PostgresSQL connected: {host}:{port}/{dbname}".format(**self._config))

src/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
dict_extra_requires = {
1515
'build': ['Cython'],
1616
'service': ['requests', 'tornado', 'psutil', 'pyjwt'],
17-
'db': ['sqlalchemy<2', 'psycopg2-binary', 'pymysql', 'elasticsearch', 'pymongo', 'redis>4.2.0'],
17+
'db': ['sqlalchemy', 'psycopg[binary]', 'pymysql', 'elasticsearch', 'pymongo', 'redis'],
1818
'stream': ['confluent_kafka'],
1919
'data': ['pandas'],
2020
'report': ['openpyxl>=3', 'XlsxWriter'],

0 commit comments

Comments
 (0)