New Features
ER Diagram Generation (sea-orm-cli generate entity --er-diagram)
sea-orm-cli can now generate a Mermaid ER diagram alongside the entity files. Pass --er-diagram to write entities.mermaid into the output directory:
sea-orm-cli generate entity -u postgres://... -o src/entity --er-diagramThe diagram annotates columns with PK, FK, and UK markers and renders all relations — including many-to-many via junction tables — as Mermaid erDiagram syntax. Example output:
PostgreSQL Statement Timeout (ConnectOptions::statement_timeout)
ConnectOptions now accepts a statement_timeout for PostgreSQL connections. The timeout is set via the connection options at connect time (no extra round-trip) and causes the server to abort any statement that exceeds the duration:
ConnectOptions::new(DATABASE_URL)
.statement_timeout(Duration::from_secs(30))
.to_owned()Has no effect on MySQL or SQLite connections.
SQLite ?mode= URL Parameter Support (#2987)
The rusqlite driver now parses the ?mode= query parameter from SQLite connection URLs, matching the behaviour of the sqlx SQLite driver:
| Mode | Behaviour |
|---|---|
rwc (default)
| Read-write, create if not exists |
rw
| Read-write, must exist |
ro
| Read-only |
memory
| In-memory database |
// Open an existing database read-only
let db = Database::connect("sqlite:./data.db?mode=ro").await?;Unsupported parameters or unknown mode values return a DbErr::Conn error.
Bug Fixes
no-default-features compile errors with mac_address and proxy (#2992)
with-mac_addressfeature: added missingTryGetableimpls,try_from_u64impl, postgres array support, andwith-jsonserde flagproxyfeature: removed an accidental hard dependency onserde_json(now only activated viawith-json)- Fixed
cfgguards on JSON/JSONB proxy row handling to requirewith-json