Skip to content

Commit

Permalink
Merge branch 'release/0.11.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
ri-gilfanov committed Jun 11, 2021
2 parents e9fbeca + ce83619 commit bde55f6
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 83 deletions.
1 change: 1 addition & 0 deletions dependabot.yml → .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ updates:
directory: "/"
schedule:
interval: "daily"
target-branch: "develop"

19 changes: 11 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ aiohttp-sqlalchemy
:target: https://aiohttp-sqlalchemy.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

.. image:: https://badge.fury.io/py/aiohttp-sqlalchemy.svg
:target: https://badge.fury.io/py/aiohttp-sqlalchemy
.. image:: https://img.shields.io/badge/Python-3.7%20%7C%203.8%20%7C%203.9-blue
:target: https://pypi.org/project/aiohttp-sqlalchemy/

.. image:: https://img.shields.io/pypi/dm/aiohttp-sqlalchemy
:target: https://pypistats.org/packages/aiohttp-sqlalchemy
Expand Down Expand Up @@ -70,13 +70,16 @@ Copy and paste this code in a file and run:
async def main(request):
async with sa_session(request).bind.begin() as conn:
await conn.run_sync(Base.metadata.create_all)
db_session = sa_session(request)
async with sa_session(request).begin():
sa_session(request).add_all([MyModel()])
result = await sa_session(request).execute(sa.select(MyModel))
data = {r.id: r.timestamp.isoformat() for r in result.scalars()}
async with db_session.bind.begin() as connection:
await connection.run_sync(Base.metadata.create_all)
async with db_session.begin():
db_session.add_all([MyModel()])
result = await db_session.execute(sa.select(MyModel))
data = {record.id: record.timestamp.isoformat()
for record in result.scalars()}
return web.json_response(data)
Expand Down
2 changes: 1 addition & 1 deletion aiohttp_sqlalchemy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
TSABinding = Tuple[TSessionFactory, str, bool]


__version__ = '0.11.0'
__version__ = '0.11.2'

__all__ = ['DuplicateAppKeyError', 'DuplicateRequestKeyError',
'SAAbstractView', 'SABaseView', 'sa_bind', 'sa_decorator',
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = 'Ruslan Ilyasovich Gilfanov'

# The full version, including alpha/beta/rc tags
release = '0.11.0'
release = '0.11.2'


# -- General configuration ---------------------------------------------------
Expand Down
19 changes: 11 additions & 8 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Overview
:target: https://aiohttp-sqlalchemy.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

.. image:: https://badge.fury.io/py/aiohttp-sqlalchemy.svg
:target: https://badge.fury.io/py/aiohttp-sqlalchemy
.. image:: https://img.shields.io/badge/Python-3.7%20%7C%203.8%20%7C%203.9-blue
:target: https://pypi.org/project/aiohttp-sqlalchemy/

.. image:: https://img.shields.io/pypi/dm/aiohttp-sqlalchemy
:target: https://pypistats.org/packages/aiohttp-sqlalchemy
Expand Down Expand Up @@ -81,13 +81,16 @@ Copy and paste this code in a file and run:
async def main(request):
async with sa_session(request).bind.begin() as conn:
await conn.run_sync(Base.metadata.create_all)
db_session = sa_session(request)
async with sa_session(request).begin():
sa_session(request).add_all([MyModel()])
result = await sa_session(request).execute(sa.select(MyModel))
data = {r.id: r.timestamp.isoformat() for r in result.scalars()}
async with db_session.bind.begin() as connection:
await connection.run_sync(Base.metadata.create_all)
async with db_session.begin():
db_session.add_all([MyModel()])
result = await db_session.execute(sa.select(MyModel))
data = {record.id: record.timestamp.isoformat()
for record in result.scalars()}
return web.json_response(data)
Expand Down
15 changes: 9 additions & 6 deletions examples/single_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ class Request(Base):


async def main(request):
async with sa_session(request).bind.begin() as conn:
await conn.run_sync(Base.metadata.create_all)
db_session = sa_session(request)

async with sa_session(request).begin():
sa_session(request).add_all([Request()])
result = await sa_session(request).execute(sa.select(Request))
data = {r.id: r.timestamp.isoformat() for r in result.scalars()}
async with db_session.bind.begin() as connection:
await connection.run_sync(Base.metadata.create_all)

async with db_session.begin():
db_session.add_all([Request()])
result = await db_session.execute(sa.select(Request))
data = {record.id: record.timestamp.isoformat()
for record in result.scalars()}
return web.json_response(data)


Expand Down
112 changes: 56 additions & 56 deletions poetry.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "aiohttp-sqlalchemy"
version = "0.11.0"
version = "0.11.2"
description = "SQLAlchemy 1.4 / 2.0 support for aiohttp."
authors = [
"Ruslan Ilyasovich Gilfanov <ri.gilfanov@yandex.ru>",
Expand Down Expand Up @@ -32,12 +32,12 @@ exclude_lines = [
[tool.poetry.dependencies]
python = "^3.7"
aiohttp = "^3.7.4.post0"
SQLAlchemy = "^1.4.17"
SQLAlchemy = "^1.4.18"

[tool.poetry.dev-dependencies]
asyncpg = ">=0.23.0"
aiosqlite = ">=0.17.0"
mypy = ">=0.901"
mypy = ">=0.902"
pytest = ">=6.2.4"
pytest-cov = ">=2.12.1"
Sphinx = ">=4.0.2"
Expand Down

0 comments on commit bde55f6

Please sign in to comment.