Skip to content

Commit

Permalink
Merge branch 'release/0.11.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
ri-gilfanov committed Jun 11, 2021
2 parents e9fbeca + 514cb6f commit 58a931a
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 21 deletions.
File renamed without changes.
15 changes: 9 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
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.1'

__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.1'


# -- General configuration ---------------------------------------------------
Expand Down
15 changes: 9 additions & 6 deletions docs/index.rst
Original file line number Diff line number Diff line change
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
2 changes: 1 addition & 1 deletion 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.1"
description = "SQLAlchemy 1.4 / 2.0 support for aiohttp."
authors = [
"Ruslan Ilyasovich Gilfanov <ri.gilfanov@yandex.ru>",
Expand Down

0 comments on commit 58a931a

Please sign in to comment.