v3.3.0
CascadeUI v3.3.0 ships PostgreSQL persistence with cross-process scoped invalidation, opens SQL-capable backends to user domain tables via a new Capability.RAW_SQL flag, adds end-to-end local file attachment support across V1 and V2, and introduces a pre-flight V2 placement validator so invalid component trees raise a local ValueError instead of returning HTTP 400 from Discord.
Added
PostgresBackendfor PostgreSQL persistence via the newpycascadeui[postgres]extra. asyncpg-backed connection pool withLISTEN/NOTIFYon a dedicated listener connection for cross-process scoped invalidation. Configure withPostgresBackend(dsn=...).- Backend extensibility via
Capability.RAW_SQLonSQLiteBackendandPostgresBackend. Four raw query methods (execute,fetch,executemany,fetch_one) plus asynctransaction()for user domain tables.placeholder_styleClassVar reports parameter syntax for portable SQL across backends. - V2 placement validator on
StatefulLayoutView-- walks the component tree before every Discord round-trip and raisesValueErrorwith a path string + fix on placements Discord 400s on (nesting, accessory misuse, Modal-only types, size bound violations). Opt out withvalidate_placement = False. file_attachment(url, *, spoiler=False)V2 builder completes the V2 media family alongsidegallery()andimage_section().- Local file attachments across
view.send()andview.refresh()-- both V1 and V2 acceptfile=/files=; mid-session swaps go throughrefresh(attachments=[...]). V2 media builders acceptdiscord.Filedirectly via the newMediaInputtype alias. The newcascadeui.fetch_as_file(url, filename, ...)helper absorbs theaiohttp+BytesIO+discord.Fileconstruction pattern into one await.examples/v2_attachments.pycovers the four attachment shapes.
Install
pip install pycascadeui==3.3.0
See the full CHANGELOG for complete detail including all internal helpers, type aliases, and documentation additions.
Full Changelog: v3.2.0...v3.3.0