Basic Use — SQLAlchemy 2.0.0b1 documentation
From Get docs
Sqlalchemy/docs/latest/orm/extensions/declarative/basic use
Basic Use
This section has moved to Declarative Mapping.
Class Constructor
As a convenience feature, the declarative_base()
sets a default constructor on classes which takes keyword arguments, and assigns them to the named attributes:
e = Engineer(primary_language='python')
Defining SQL Expressions
See SQL Expressions as Mapped Attributes for examples on declaratively mapping attributes to SQL expressions.