Skip to content

Commit

Permalink
support asyncpg 0.22.0 (#111)
Browse files Browse the repository at this point in the history
* support asyncpg 0.22.0

* Update asyncpgsa/connection.py

Co-authored-by: Freddie Lindsey <freddie.a.lindsey@gmail.com>

* Update asyncpgsa/connection.py

Co-authored-by: Freddie Lindsey <freddie.a.lindsey@gmail.com>

* Remove old versions, no longer supported

Co-authored-by: Nick Humrich <nick.humrich@gmail.com>
Co-authored-by: Freddie Lindsey <freddie.a.lindsey@gmail.com>
Co-authored-by: Nick Humrich <nick@humrich.us>
  • Loading branch information
4 people committed Feb 12, 2021
1 parent bd4eb42 commit b9e928c
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 14 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -23,6 +23,7 @@ var/
*.egg-info/
.installed.cfg
*.egg
.venv/

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down Expand Up @@ -96,3 +97,6 @@ ENV/
.vscode/*
.history
*.code-workspace

# Other
.tool-versions
8 changes: 3 additions & 5 deletions .travis.yml
Expand Up @@ -7,14 +7,12 @@ dist: xenial
sudo: true

python:
- "3.5"
- "3.6"
- "3.7"
- "3.8"
- "3.9"

env:
- ASYNCPG_VERSION=0.15.0
- ASYNCPG_VERSION=0.16.0
- ASYNCPG_VERSION=0.17.0
- ASYNCPG_VERSION=0.22.0

# command to install dependencies
install:
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
@@ -1,10 +1,10 @@
FROM python:3.7-alpine
FROM python:3.8-alpine

RUN apk update && \
apk add \
gcc \
musl-dev \
postgresql-dev
gcc \
musl-dev \
postgresql-dev

ADD dev-requirements.txt /repo/dev-requirements.txt
RUN pip install -r /repo/dev-requirements.txt
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -23,6 +23,7 @@ for columns is no longer possible and you need to access columns using exact nam

3. 0.18.0 Removed the `insert` method. We found this method was just confusing, and useless as SqlAlchemy can do it for you by defining your table with a primary key.

4. 0.27.0 Now only compatible with version 0.22.0 and greater of asyncpg.

## sqlalchemy ORM

Expand Down
6 changes: 4 additions & 2 deletions asyncpgsa/connection.py
Expand Up @@ -88,11 +88,13 @@ def __init__(self, *args, dialect=None, **kwargs):
super().__init__(*args, **kwargs)
self._dialect = dialect or _dialect

def _execute(self, query, args, limit, timeout, return_status=False):
def _execute(self, query, args, limit, timeout, return_status=False, record_class=None, ignore_custom_codec=False):
query, compiled_args = compile_query(query, dialect=self._dialect)
args = compiled_args or args
return super()._execute(query, args, limit, timeout,
return_status=return_status)
return_status=return_status,
record_class=record_class,
ignore_custom_codec=ignore_custom_codec)

async def execute(self, script, *args, **kwargs) -> str:
script, params = compile_query(script, dialect=self._dialect)
Expand Down
4 changes: 3 additions & 1 deletion asyncpgsa/testing/mockpool.py
@@ -1,4 +1,5 @@
from asyncpgsa import compile_query
from asyncpg import protocol
from asyncpg.pool import Pool

from .mockconnection import MockConnection
Expand All @@ -14,7 +15,8 @@ def __init__(self, connection=None):
setup=None,
loop=None,
init=None,
connection_class=MockConnection)
connection_class=MockConnection,
record_class=protocol.Record)

self.connection = connection
if not self.connection:
Expand Down
2 changes: 1 addition & 1 deletion asyncpgsa/version.py
@@ -1 +1 @@
__version__ = '0.26.3'
__version__ = '0.27.0'
2 changes: 1 addition & 1 deletion dev-requirements.txt
Expand Up @@ -2,4 +2,4 @@ asyncpg
pytest
pytest-asyncio
sqlalchemy
psycopg2
psycopg2-binary

0 comments on commit b9e928c

Please sign in to comment.