Skip to content

Commit bd69893

Browse files
authored
Merge pull request #42 from febus982/fix_async_examples
Fix async code examples
2 parents 2e6bc11 + d3a0c9a commit bd69893

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

docs/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ The scope of this package is to:
2626

2727
* Be able to setup a basic application with a few lines of code
2828
* Avoid common pitfalls found in other plugins for session lifecycle
29+
* Allow to build a [decoupled application](https://github.com/febus982/bootstrap-python-fastapi) without being bound to HTTP frameworks
2930

3031
## Components maturity
3132

@@ -73,7 +74,7 @@ o = MyModel()
7374
o.name = "John"
7475
with sa_manager.get_session() as session:
7576
session.add(o)
76-
session.commit()
77+
await session.commit()
7778
```
7879

7980
/// details | Long lived sessions and multithreading

docs/manager/config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ The interfaces are exactly the same, however you'll need to `await` the relevant
8282
```python
8383
async with sa_manager.get_session() as session:
8484
session.add(o)
85-
session.commit()
85+
await session.commit()
8686
```
8787

8888
Note that async implementation has several differences from the sync one, make sure

0 commit comments

Comments
 (0)