CodeVetter · Repo Unpack · Feature catalog
sqlalchemy/sqlalchemy
Users interact through Python statement, schema, connection, mapping, and session APIs. Core supports compiled expressions and direct driver SQL, with results returned through row and scalar interfaces. ORM features include several mapping styles, object persistence, identity reuse, and relationship loading. Async connections add awaited execution and streaming over the same underlying engine architecture; the catalog groups the inspected capabilities rather than claiming exhaustive API coverage.
- Connection.execute accepts executable Select, Insert, Update, Delete, TextClause, and DDL constructs, with dictionaries or sequences of dictionaries supplying bound parameters.
- exec_driver_sql sends SQL strings directly to the DBAPI without compilation and requires parameters in the driver's own paramstyle.
- MetaData.create_all conditionally creates registered tables and accepts a subset; MetaData.reflect loads existing table definitions with schema, view, name-filter, and foreign-key options.
- DeclarativeBase supports typed declarative models, while registry also offers generate_base, mapped decorators, and map_imperatively for classical mappings.
- Session.add moves transient objects to pending state; flush writes creations, modifications, and deletions, and commit completes the transaction and normally expires objects.
- ORM row loading reuses objects by identity key; joinedload and subqueryload can require buffering or uniquing that is incompatible with yield_per, with selectinload suggested as an alternative.
- Connection context managers return DBAPI resources to the pool and roll back unfinished transactions; async transaction APIs expose commit, rollback, and nested savepoint behavior.
- create_async_engine requires an async-compatible dialect, AsyncConnection.execute returns buffered results, and streaming uses connection.stream rather than a global server_side_cursors option.