Skip to content

Commit 013ddd6

Browse files
committed
fix api links
1 parent 36abb96 commit 013ddd6

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

docs/engine.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ The connection charset is set to `utf8mb4`.
9797

9898
## The Default Engine and Bind
9999

100-
The `"default"` key is special, and will be used for {attr}`.SQLAlchemy.engine`
101-
and as the default bind for {attr}`.SQLAlchemy.sessionmaker`. By default, it is
100+
The `"default"` key is special, and will be used for {attr}`~.SQLAlchemy.engine`
101+
and as the default bind for {attr}`~.SQLAlchemy.sessionmaker`. By default, it is
102102
an error not to configure it for one of sync or async engines.
103103

104104

@@ -107,7 +107,7 @@ an error not to configure it for one of sync or async engines.
107107
You can ignore the Flask config altogether and create engines yourself. In that
108108
case, you pass `require_default_engine=False` when creating the extension to
109109
ignore the check for default config. Adding custom engines to the
110-
{attr}`.SQLAlchemy.engines` map will make them accessible through the extension,
110+
{attr}`~.SQLAlchemy.engines` map will make them accessible through the extension,
111111
but that's not required either. You will want to call
112112
`db.sessionmaker.configure(bind=..., binds=...)` to set up these custom engines
113113
if you plan to use the provided session management though.

docs/session.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ different options for each.
1616
## Session Management
1717

1818
Most use cases will use one session, and tie it to the lifetime of each request.
19-
Use {attr}`db.session <SQLAlchemy.session>` for this. It will return the same
19+
Use {attr}`db.session <.SQLAlchemy.session>` for this. It will return the same
2020
session throughout a request, then close it when the request ends. SQLAlchemy
2121
will rollback any uncomitted state in the session when it is closed.
2222

2323
You can also create other sessions besides the default. Calling
24-
{meth}`db.get_session(name)` will create separate sessions that are also closed
25-
at the end of the request.
24+
{meth}`db.get_session(name) <.SQLAlchemy.get_session>` will create separate
25+
sessions that are also closed at the end of the request.
2626

2727
The sessions are closed when the application context is torn down. This happens
2828
for each request, but also at the end of CLI commands, and for manual
@@ -31,7 +31,7 @@ for each request, but also at the end of CLI commands, and for manual
3131

3232
### Manual Sessions
3333

34-
You can also use {attr}`db.sessionmaker <SQLAlchemy.sessionmaker>` directly to
34+
You can also use {attr}`db.sessionmaker <.SQLAlchemy.sessionmaker>` directly to
3535
create sessions. These will not be closed automatically at the end of requests,
3636
so you'll need to manage them manually. An easy way to do that is using a `with`
3737
block.
@@ -47,9 +47,10 @@ with db.sessionmaker() as session:
4747
SQLAlchemy warns that the async sessions it provides are _not_ safe to be used
4848
across concurrent tasks. For example, the same session should not be passed to
4949
multiple tasks when using `asyncio.gather`. Either use
50-
{meth}`db.get_async_session(name) <SQLAlchemy.get_async_session>` with a unique
51-
name for each task, or use {attr}`db.async_sessionmaker` to manage sessions
52-
and their lifetime manually. The latter is what SQLAlchemy recommends.
50+
{meth}`db.get_async_session(name) <.SQLAlchemy.get_async_session>` with a unique
51+
name for each task, or use
52+
{attr}`db.async_sessionmaker <.SQLAlchemy.async_sessionmaker>` to manage session
53+
lifetimes manually. The latter is what SQLAlchemy recommends.
5354

5455

5556
## Multiple Binds

docs/start.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ SQLAlchemy.
1515
Create an instance of {class}`.SQLAlchemy`. Define the
1616
{data}`.SQLALCHEMY_ENGINES` config, a dict, with at least the `"default"` key
1717
with a [connection string] value. When setting up the Flask app, call the
18-
extension's {meth}`.SQLAlchemy.init_app` method.
18+
extension's {meth}`~.SQLAlchemy.init_app` method.
1919

2020
[connection string]: https://docs.sqlalchemy.org/core/engines.html#database-urls
2121

@@ -200,6 +200,7 @@ be aware of than with sync usage.
200200
In particular, SQLAlchemy warns that the async sessions it provides are _not_
201201
safe to be used across concurrent tasks. For example, the same session should
202202
not be passed to multiple tasks when using `asyncio.gather`. Either use
203-
{meth}`db.get_async_session(name) <SQLAlchemy.get_async_session>` with a unique
204-
name for each task, or use {attr}`db.async_sessionmaker` to manage sessions
205-
and their lifetime manually. The latter is what SQLAlchemy recommends.
203+
{meth}`db.get_async_session(name) <.SQLAlchemy.get_async_session>` with a unique
204+
name for each task, or use
205+
{attr}`db.async_sessionmaker <.SQLAlchemy.async_sessionmaker>` to manage session
206+
lifetimes manually. The latter is what SQLAlchemy recommends.

0 commit comments

Comments
 (0)