Skip to content

Commit 4d6a110

Browse files
authored
docs: clarify database driver installation for SQLAlchemy sessions (#4743)
1 parent 67169f6 commit 4d6a110

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

docs/sessions/sqlalchemy_session.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,18 @@
44

55
## Installation
66

7-
SQLAlchemy sessions require the `sqlalchemy` optional-dependency extra from the `openai-agents` package:
7+
SQLAlchemy sessions require the `sqlalchemy` optional-dependency extra and an async database driver that matches your database URL.
8+
9+
For the SQLite examples below (`sqlite+aiosqlite://`), install `aiosqlite` alongside the extra:
10+
11+
```bash
12+
pip install 'openai-agents[sqlalchemy]' aiosqlite
13+
```
14+
15+
The extra already includes `asyncpg` for PostgreSQL URLs that start with `postgresql+asyncpg://`. For MySQL URLs that start with `mysql+aiomysql://`, install `aiomysql` alongside the extra. The driver's `rsa` extra supplies dependencies for MySQL's SHA-256 authentication methods:
816

917
```bash
10-
pip install openai-agents[sqlalchemy]
18+
pip install 'openai-agents[sqlalchemy]' 'aiomysql[rsa]'
1119
```
1220

1321
## Quick start

0 commit comments

Comments
 (0)