Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
automap.cpython-313.pyc1056 linesDownload Raw Back to __pycache__
1�

2��j�����SrSSKJr SSKrSSKJr SSKJr SSKJr SSKJr SSKJ	r	 SS	KJ3r4 SS5KJr SSKJr SSKJ
r
 SS
KJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSK J!r! SSK"J#r# SSK$J%r% SSKJ&r& SSK'J(r( \(a0SS K)J*r* SS!K+J,r, SS"K-J.r. SS#K-J/r/ SS$K0J1r1 SS%K0J2r2 SS&K0J3r3 SS'KJ4r4 \"S(\S)9r5\"S*\S)9r6"S+S,\(5r7SBS-jr8"S.S/\(5r9SCS0jr:"S1S2\(5r;SCS3jr<"S4S5\(5r=\
SDS6j5r>\
SES7j5r>SFS8jr>\&\S9\\4r?"S:S;5r@\R�"S<S=55rBSGSHS>jjrCSIS?jrDSJS@jrESKSAjrFg)LaiDefine an extension to the :mod:`sqlalchemy.ext.declarative` system6which automatically generates mapped classes and relationships from a database7schema, typically though not necessarily one which is reflected.8 9It is hoped that the :class:`.AutomapBase` system provides a quick10and modernized solution to the problem that the very famous11`SQLSoup <https://pypi.org/project/sqlsoup/>`_12also tries to solve, that of generating a quick and rudimentary object13model from an existing database on the fly.  By addressing the issue strictly14at the mapper configuration level, and integrating fully with existing15Declarative class techniques, :class:`.AutomapBase` seeks to provide16a well-integrated approach to the issue of expediently auto-generating ad-hoc17mappings.18 19.. tip:: The :ref:`automap_toplevel` extension is geared towards a20   "zero declaration" approach, where a complete ORM model including classes21   and pre-named relationships can be generated on the fly from a database22   schema. For applications that still want to use explicit class declarations23   including explicit relationship definitions in conjunction with reflection24   of tables, the :class:`.DeferredReflection` class, described at25   :ref:`orm_declarative_reflected_deferred_reflection`, is a better choice.26 27.. _automap_basic_use:28 29Basic Use30=========31 32The simplest usage is to reflect an existing database into a new model.33We create a new :class:`.AutomapBase` class in a similar manner as to how34we create a declarative base class, using :func:`.automap_base`.35We then call :meth:`.AutomapBase.prepare` on the resulting base class,36asking it to reflect the schema and produce mappings::37 38    from sqlalchemy.ext.automap import automap_base39    from sqlalchemy.orm import Session40    from sqlalchemy import create_engine41 42    Base = automap_base()43 44    # engine, suppose it has two tables 'user' and 'address' set up45    engine = create_engine("sqlite:///mydatabase.db")46 47    # reflect the tables48    Base.prepare(autoload_with=engine)49 50    # mapped classes are now created with names by default51    # matching that of the table name.52    User = Base.classes.user53    Address = Base.classes.address54 55    session = Session(engine)56 57    # rudimentary relationships are produced58    session.add(Address(email_address="foo@bar.com", user=User(name="foo")))59    session.commit()60 61    # collection-based relationships are by default named62    # "<classname>_collection"63    u1 = session.query(User).first()64    print(u1.address_collection)65 66Above, calling :meth:`.AutomapBase.prepare` while passing along the67:paramref:`.AutomapBase.prepare.reflect` parameter indicates that the68:meth:`_schema.MetaData.reflect`69method will be called on this declarative base70classes' :class:`_schema.MetaData` collection; then, each **viable**71:class:`_schema.Table` within the :class:`_schema.MetaData`72will get a new mapped class73generated automatically.  The :class:`_schema.ForeignKeyConstraint`74objects which75link the various tables together will be used to produce new, bidirectional76:func:`_orm.relationship` objects between classes.77The classes and relationships78follow along a default naming scheme that we can customize.  At this point,79our basic mapping consisting of related ``User`` and ``Address`` classes is80ready to use in the traditional way.81 82.. note:: By **viable**, we mean that for a table to be mapped, it must83   specify a primary key.  Additionally, if the table is detected as being84   a pure association table between two other tables, it will not be directly85   mapped and will instead be configured as a many-to-many table between86   the mappings for the two referring tables.87 88Generating Mappings from an Existing MetaData89=============================================90 91We can pass a pre-declared :class:`_schema.MetaData` object to92:func:`.automap_base`.93This object can be constructed in any way, including programmatically, from94a serialized file, or from itself being reflected using95:meth:`_schema.MetaData.reflect`.96Below we illustrate a combination of reflection and97explicit table declaration::98 99    from sqlalchemy import create_engine, MetaData, Table, Column, ForeignKey100    from sqlalchemy.ext.automap import automap_base101 102    engine = create_engine("sqlite:///mydatabase.db")103 104    # produce our own MetaData object105    metadata = MetaData()106 107    # we can reflect it ourselves from a database, using options108    # such as 'only' to limit what tables we look at...109    metadata.reflect(engine, only=["user", "address"])110 111    # ... or just define our own Table objects with it (or combine both)112    Table(113        "user_order",114        metadata,115        Column("id", Integer, primary_key=True),116        Column("user_id", ForeignKey("user.id")),117    )118 119    # we can then produce a set of mappings from this MetaData.120    Base = automap_base(metadata=metadata)121 122    # calling prepare() just sets up mapped classes and relationships.123    Base.prepare()124 125    # mapped classes are ready126    User = Base.classes.user127    Address = Base.classes.address128    Order = Base.classes.user_order129 130.. _automap_by_module:131 132Generating Mappings from Multiple Schemas133=========================================134 135The :meth:`.AutomapBase.prepare` method when used with reflection may reflect136tables from one schema at a time at most, using the137:paramref:`.AutomapBase.prepare.schema` parameter to indicate the name of a138schema to be reflected from. In order to populate the :class:`.AutomapBase`139with tables from multiple schemas, :meth:`.AutomapBase.prepare` may be invoked140multiple times, each time passing a different name to the141:paramref:`.AutomapBase.prepare.schema` parameter. The142:meth:`.AutomapBase.prepare` method keeps an internal list of143:class:`_schema.Table` objects that have already been mapped, and will add new144mappings only for those :class:`_schema.Table` objects that are new since the145last time :meth:`.AutomapBase.prepare` was run::146 147    e = create_engine("postgresql://scott:tiger@localhost/test")148 149    Base.metadata.create_all(e)150 151    Base = automap_base()152 153    Base.prepare(e)154    Base.prepare(e, schema="test_schema")155    Base.prepare(e, schema="test_schema_2")156 157.. versionadded:: 2.0  The :meth:`.AutomapBase.prepare` method may be called158   any number of times; only newly added tables will be mapped159   on each run.   Previously in version 1.4 and earlier, multiple calls would160   cause errors as it would attempt to re-map an already mapped class.161   The previous workaround approach of invoking162   :meth:`_schema.MetaData.reflect` directly remains available as well.163 164Automapping same-named tables across multiple schemas165-----------------------------------------------------166 167For the common case where multiple schemas may have same-named tables and168therefore would generate same-named classes, conflicts can be resolved either169through use of the :paramref:`.AutomapBase.prepare.classname_for_table` hook to170apply different classnames on a per-schema basis, or by using the171:paramref:`.AutomapBase.prepare.modulename_for_table` hook, which allows172disambiguation of same-named classes by changing their effective ``__module__``173attribute. In the example below, this hook is used to create a ``__module__``174attribute for all classes that is of the form ``mymodule.<schemaname>``, where175the schema name ``default`` is used if no schema is present::176 177    e = create_engine("postgresql://scott:tiger@localhost/test")178 179    Base.metadata.create_all(e)180 181 182    def module_name_for_table(cls, tablename, table):183        if table.schema is not None:184            return f"mymodule.{table.schema}"185        else:186            return f"mymodule.default"187 188 189    Base = automap_base()190 191    Base.prepare(e, modulename_for_table=module_name_for_table)192    Base.prepare(193        e, schema="test_schema", modulename_for_table=module_name_for_table194    )195    Base.prepare(196        e, schema="test_schema_2", modulename_for_table=module_name_for_table197    )198 199The same named-classes are organized into a hierarchical collection available200at :attr:`.AutomapBase.by_module`.  This collection is traversed using the201dot-separated name of a particular package/module down into the desired202class name.203 204.. note:: When using the :paramref:`.AutomapBase.prepare.modulename_for_table`205   hook to return a new ``__module__`` that is not ``None``, the class is206   **not** placed into the :attr:`.AutomapBase.classes` collection; only207   classes that were not given an explicit modulename are placed here, as the208   collection cannot represent same-named classes individually.209 210In the example above, if the database contained a table named ``accounts`` in211all three of the default schema, the ``test_schema`` schema, and the212``test_schema_2`` schema, three separate classes will be available as::213 214    Base.by_module.mymodule.default.accounts215    Base.by_module.mymodule.test_schema.accounts216    Base.by_module.mymodule.test_schema_2.accounts217 218The default module namespace generated for all :class:`.AutomapBase` classes is219``sqlalchemy.ext.automap``. If no220:paramref:`.AutomapBase.prepare.modulename_for_table` hook is used, the221contents of :attr:`.AutomapBase.by_module` will be entirely within the222``sqlalchemy.ext.automap`` namespace (e.g.223``MyBase.by_module.sqlalchemy.ext.automap.<classname>``), which would contain224the same series of classes as what would be seen in225:attr:`.AutomapBase.classes`. Therefore it's generally only necessary to use226:attr:`.AutomapBase.by_module` when explicit ``__module__`` conventions are227present.228 229.. versionadded: 2.0230 231    Added the :attr:`.AutomapBase.by_module` collection, which stores232    classes within a named hierarchy based on dot-separated module names,233    as well as the :paramref:`.Automap.prepare.modulename_for_table` parameter234    which allows for custom ``__module__`` schemes for automapped235    classes.236 237 238 239Specifying Classes Explicitly240=============================241 242.. tip:: If explicit classes are expected to be prominent in an application,243   consider using :class:`.DeferredReflection` instead.244 245The :mod:`.sqlalchemy.ext.automap` extension allows classes to be defined246explicitly, in a way similar to that of the :class:`.DeferredReflection` class.247Classes that extend from :class:`.AutomapBase` act like regular declarative248classes, but are not immediately mapped after their construction, and are249instead mapped when we call :meth:`.AutomapBase.prepare`.  The250:meth:`.AutomapBase.prepare` method will make use of the classes we've251established based on the table name we use.  If our schema contains tables252``user`` and ``address``, we can define one or both of the classes to be used::253 254    from sqlalchemy.ext.automap import automap_base255    from sqlalchemy import create_engine256 257    # automap base258    Base = automap_base()259 260 261    # pre-declare User for the 'user' table262    class User(Base):263        __tablename__ = "user"264 265        # override schema elements like Columns266        user_name = Column("name", String)267 268        # override relationships too, if desired.269        # we must use the same name that automap would use for the270        # relationship, and also must refer to the class name that automap will271        # generate for "address"272        address_collection = relationship("address", collection_class=set)273 274 275    # reflect276    engine = create_engine("sqlite:///mydatabase.db")277    Base.prepare(autoload_with=engine)278 279    # we still have Address generated from the tablename "address",280    # but User is the same as Base.classes.User now281 282    Address = Base.classes.address283 284    u1 = session.query(User).first()285    print(u1.address_collection)286 287    # the backref is still there:288    a1 = session.query(Address).first()289    print(a1.user)290 291Above, one of the more intricate details is that we illustrated overriding292one of the :func:`_orm.relationship` objects that automap would have created.293To do this, we needed to make sure the names match up with what automap294would normally generate, in that the relationship name would be295``User.address_collection`` and the name of the class referred to, from296automap's perspective, is called ``address``, even though we are referring to297it as ``Address`` within our usage of this class.298 299Overriding Naming Schemes300=========================301 302:mod:`.sqlalchemy.ext.automap` is tasked with producing mapped classes and303relationship names based on a schema, which means it has decision points in how304these names are determined.  These three decision points are provided using305functions which can be passed to the :meth:`.AutomapBase.prepare` method, and306are known as :func:`.classname_for_table`,307:func:`.name_for_scalar_relationship`,308and :func:`.name_for_collection_relationship`.  Any or all of these309functions are provided as in the example below, where we use a "camel case"310scheme for class names and a "pluralizer" for collection names using the311`Inflect <https://pypi.org/project/inflect>`_ package::312 313    import re314    import inflect315 316 317    def camelize_classname(base, tablename, table):318        "Produce a 'camelized' class name, e.g."319        "'words_and_underscores' -> 'WordsAndUnderscores'"320 321        return str(322            tablename[0].upper()323            + re.sub(324                r"_([a-z])",325                lambda m: m.group(1).upper(),326                tablename[1:],327            )328        )329 330 331    _pluralizer = inflect.engine()332 333 334    def pluralize_collection(base, local_cls, referred_cls, constraint):335        "Produce an 'uncamelized', 'pluralized' class name, e.g."336        "'SomeTerm' -> 'some_terms'"337 338        referred_name = referred_cls.__name__339        uncamelized = re.sub(340            r"[A-Z]",341            lambda m: "_%s" % m.group(0).lower(),342            referred_name,343        )[1:]344        pluralized = _pluralizer.plural(uncamelized)345        return pluralized346 347 348    from sqlalchemy.ext.automap import automap_base349 350    Base = automap_base()351 352    engine = create_engine("sqlite:///mydatabase.db")353 354    Base.prepare(355        autoload_with=engine,356        classname_for_table=camelize_classname,357        name_for_collection_relationship=pluralize_collection,358    )359 360From the above mapping, we would now have classes ``User`` and ``Address``,361where the collection from ``User`` to ``Address`` is called362``User.addresses``::363 364    User, Address = Base.classes.User, Base.classes.Address365 366    u1 = User(addresses=[Address(email="foo@bar.com")])367 368Relationship Detection369======================370 371The vast majority of what automap accomplishes is the generation of372:func:`_orm.relationship` structures based on foreign keys.  The mechanism373by which this works for many-to-one and one-to-many relationships is as374follows:375 3761. A given :class:`_schema.Table`, known to be mapped to a particular class,377   is examined for :class:`_schema.ForeignKeyConstraint` objects.378 3792. From each :class:`_schema.ForeignKeyConstraint`, the remote380   :class:`_schema.Table`381   object present is matched up to the class to which it is to be mapped,382   if any, else it is skipped.383 3843. As the :class:`_schema.ForeignKeyConstraint`385   we are examining corresponds to a386   reference from the immediate mapped class,  the relationship will be set up387   as a many-to-one referring to the referred class; a corresponding388   one-to-many backref will be created on the referred class referring389   to this class.390 3914. If any of the columns that are part of the392   :class:`_schema.ForeignKeyConstraint`393   are not nullable (e.g. ``nullable=False``), a394   :paramref:`_orm.relationship.cascade` keyword argument395   of ``all, delete-orphan`` will be added to the keyword arguments to396   be passed to the relationship or backref.  If the397   :class:`_schema.ForeignKeyConstraint` reports that398   :paramref:`_schema.ForeignKeyConstraint.ondelete`399   is set to ``CASCADE`` for a not null or ``SET NULL`` for a nullable400   set of columns, the option :paramref:`_orm.relationship.passive_deletes`401   flag is set to ``True`` in the set of relationship keyword arguments.402   Note that not all backends support reflection of ON DELETE.403 4045. The names of the relationships are determined using the405   :paramref:`.AutomapBase.prepare.name_for_scalar_relationship` and406   :paramref:`.AutomapBase.prepare.name_for_collection_relationship`407   callable functions.  It is important to note that the default relationship408   naming derives the name from the **the actual class name**.  If you've409   given a particular class an explicit name by declaring it, or specified an410   alternate class naming scheme, that's the name from which the relationship411   name will be derived.412 4136. The classes are inspected for an existing mapped property matching these414   names.  If one is detected on one side, but none on the other side,415   :class:`.AutomapBase` attempts to create a relationship on the missing side,416   then uses the :paramref:`_orm.relationship.back_populates`417   parameter in order to418   point the new relationship to the other side.419 4207. In the usual case where no relationship is on either side,421   :meth:`.AutomapBase.prepare` produces a :func:`_orm.relationship` on the422   "many-to-one" side and matches it to the other using the423   :paramref:`_orm.relationship.backref` parameter.424 4258. Production of the :func:`_orm.relationship` and optionally the426   :func:`.backref`427   is handed off to the :paramref:`.AutomapBase.prepare.generate_relationship`428   function, which can be supplied by the end-user in order to augment429   the arguments passed to :func:`_orm.relationship` or :func:`.backref` or to430   make use of custom implementations of these functions.431 432Custom Relationship Arguments433-----------------------------434 435The :paramref:`.AutomapBase.prepare.generate_relationship` hook can be used436to add parameters to relationships.  For most cases, we can make use of the437existing :func:`.automap.generate_relationship` function to return438the object, after augmenting the given keyword dictionary with our own439arguments.440 441Below is an illustration of how to send442:paramref:`_orm.relationship.cascade` and443:paramref:`_orm.relationship.passive_deletes`444options along to all one-to-many relationships::445 446    from sqlalchemy.ext.automap import generate_relationship447    from sqlalchemy.orm import interfaces448 449 450    def _gen_relationship(451        base, direction, return_fn, attrname, local_cls, referred_cls, **kw452    ):453        if direction is interfaces.ONETOMANY:454            kw["cascade"] = "all, delete-orphan"455            kw["passive_deletes"] = True456        # make use of the built-in function to actually return457        # the result.458        return generate_relationship(459            base, direction, return_fn, attrname, local_cls, referred_cls, **kw460        )461 462 463    from sqlalchemy.ext.automap import automap_base464    from sqlalchemy import create_engine465 466    # automap base467    Base = automap_base()468 469    engine = create_engine("sqlite:///mydatabase.db")470    Base.prepare(autoload_with=engine, generate_relationship=_gen_relationship)471 472Many-to-Many relationships473--------------------------474 475:mod:`.sqlalchemy.ext.automap` will generate many-to-many relationships, e.g.476those which contain a ``secondary`` argument.  The process for producing these477is as follows:478 4791. A given :class:`_schema.Table` is examined for480   :class:`_schema.ForeignKeyConstraint`481   objects, before any mapped class has been assigned to it.482 4832. If the table contains two and exactly two484   :class:`_schema.ForeignKeyConstraint`485   objects, and all columns within this table are members of these two486   :class:`_schema.ForeignKeyConstraint` objects, the table is assumed to be a487   "secondary" table, and will **not be mapped directly**.488 4893. The two (or one, for self-referential) external tables to which the490   :class:`_schema.Table`491   refers to are matched to the classes to which they will be492   mapped, if any.493 4944. If mapped classes for both sides are located, a many-to-many bi-directional495   :func:`_orm.relationship` / :func:`.backref`496   pair is created between the two497   classes.498 4995. The override logic for many-to-many works the same as that of one-to-many/500   many-to-one; the :func:`.generate_relationship` function is called upon501   to generate the structures and existing attributes will be maintained.502 503Relationships with Inheritance504------------------------------505 506:mod:`.sqlalchemy.ext.automap` will not generate any relationships between507two classes that are in an inheritance relationship.   That is, with two508classes given as follows::509 510    class Employee(Base):511        __tablename__ = "employee"512        id = Column(Integer, primary_key=True)513        type = Column(String(50))514        __mapper_args__ = {515            "polymorphic_identity": "employee",516            "polymorphic_on": type,517        }518 519 520    class Engineer(Employee):521        __tablename__ = "engineer"522        id = Column(Integer, ForeignKey("employee.id"), primary_key=True)523        __mapper_args__ = {524            "polymorphic_identity": "engineer",525        }526 527The foreign key from ``Engineer`` to ``Employee`` is used not for a528relationship, but to establish joined inheritance between the two classes.529 530Note that this means automap will not generate *any* relationships531for foreign keys that link from a subclass to a superclass.  If a mapping532has actual relationships from subclass to superclass as well, those533need to be explicit.  Below, as we have two separate foreign keys534from ``Engineer`` to ``Employee``, we need to set up both the relationship535we want as well as the ``inherit_condition``, as these are not things536SQLAlchemy can guess::537 538    class Employee(Base):539        __tablename__ = "employee"540        id = Column(Integer, primary_key=True)541        type = Column(String(50))542 543        __mapper_args__ = {544            "polymorphic_identity": "employee",545            "polymorphic_on": type,546        }547 548 549    class Engineer(Employee):550        __tablename__ = "engineer"551        id = Column(Integer, ForeignKey("employee.id"), primary_key=True)552        favorite_employee_id = Column(Integer, ForeignKey("employee.id"))553 554        favorite_employee = relationship(555            Employee, foreign_keys=favorite_employee_id556        )557 558        __mapper_args__ = {559            "polymorphic_identity": "engineer",560            "inherit_condition": id == Employee.id,561        }562 563Handling Simple Naming Conflicts564--------------------------------565 566In the case of naming conflicts during mapping, override any of567:func:`.classname_for_table`, :func:`.name_for_scalar_relationship`,568and :func:`.name_for_collection_relationship` as needed.  For example, if569automap is attempting to name a many-to-one relationship the same as an570existing column, an alternate convention can be conditionally selected.  Given571a schema:572 573.. sourcecode:: sql574 575    CREATE TABLE table_a (576        id INTEGER PRIMARY KEY577    );578 579    CREATE TABLE table_b (580        id INTEGER PRIMARY KEY,581        table_a INTEGER,582        FOREIGN KEY(table_a) REFERENCES table_a(id)583    );584 585The above schema will first automap the ``table_a`` table as a class named586``table_a``; it will then automap a relationship onto the class for ``table_b``587with the same name as this related class, e.g. ``table_a``.  This588relationship name conflicts with the mapping column ``table_b.table_a``,589and will emit an error on mapping.590 591We can resolve this conflict by using an underscore as follows::592 593    def name_for_scalar_relationship(594        base, local_cls, referred_cls, constraint595    ):596        name = referred_cls.__name__.lower()597        local_table = local_cls.__table__598        if name in local_table.columns:599            newname = name + "_"600            warnings.warn(601                "Already detected name %s present.  using %s" % (name, newname)602            )603            return newname604        return name605 606 607    Base.prepare(608        autoload_with=engine,609        name_for_scalar_relationship=name_for_scalar_relationship,610    )611 612Alternatively, we can change the name on the column side.   The columns613that are mapped can be modified using the technique described at614:ref:`mapper_column_distinct_names`, by assigning the column explicitly615to a new name::616 617    Base = automap_base()618 619 620    class TableB(Base):621        __tablename__ = "table_b"622        _table_a = Column("table_a", ForeignKey("table_a.id"))623 624 625    Base.prepare(autoload_with=engine)626 627Using Automap with Explicit Declarations628========================================629 630As noted previously, automap has no dependency on reflection, and can make631use of any collection of :class:`_schema.Table` objects within a632:class:`_schema.MetaData`633collection.  From this, it follows that automap can also be used634generate missing relationships given an otherwise complete model that fully635defines table metadata::636 637    from sqlalchemy.ext.automap import automap_base638    from sqlalchemy import Column, Integer, String, ForeignKey639 640    Base = automap_base()641 642 643    class User(Base):644        __tablename__ = "user"645 646        id = Column(Integer, primary_key=True)647        name = Column(String)648 649 650    class Address(Base):651        __tablename__ = "address"652 653        id = Column(Integer, primary_key=True)654        email = Column(String)655        user_id = Column(ForeignKey("user.id"))656 657 658    # produce relationships659    Base.prepare()660 661    # mapping is complete, with "address_collection" and662    # "user" relationships663    a1 = Address(email="u1")664    a2 = Address(email="u2")665    u1 = User(address_collection=[a1, a2])666    assert a1.user is u1667 668Above, given mostly complete ``User`` and ``Address`` mappings, the669:class:`_schema.ForeignKey` which we defined on ``Address.user_id`` allowed a670bidirectional relationship pair ``Address.user`` and671``User.address_collection`` to be generated on the mapped classes.672 673Note that when subclassing :class:`.AutomapBase`,674the :meth:`.AutomapBase.prepare` method is required; if not called, the classes675we've declared are in an un-mapped state.676 677 678.. _automap_intercepting_columns:679 680Intercepting Column Definitions681===============================682 683The :class:`_schema.MetaData` and :class:`_schema.Table` objects support an684event hook :meth:`_events.DDLEvents.column_reflect` that may be used to intercept685the information reflected about a database column before the :class:`_schema.Column`686object is constructed.   For example if we wanted to map columns using a687naming convention such as ``"attr_<columnname>"``, the event could688be applied as::689 690    @event.listens_for(Base.metadata, "column_reflect")691    def column_reflect(inspector, table, column_info):692        # set column.key = "attr_<lower_case_name>"693        column_info["key"] = "attr_%s" % column_info["name"].lower()694 695 696    # run reflection697    Base.prepare(autoload_with=engine)698 699.. versionadded:: 1.4.0b2 the :meth:`_events.DDLEvents.column_reflect` event700   may be applied to a :class:`_schema.MetaData` object.701 702.. seealso::703 704      :meth:`_events.DDLEvents.column_reflect`705 706      :ref:`mapper_automated_reflection_schemes` - in the ORM mapping documentation707 708 709�)�annotationsN)�Any)�Callable)�cast)�ClassVar)�Dict)�List)�NoReturn)�Optional)�overload)�Set)�Tuple)�Type)�
TYPE_CHECKING)�TypeVar)�Union�)�util)�backref)�declarative_base)�exc)�710interfaces)�relationship)�_DeferredMapperConfig)�_CONFIGURE_MUTEX)�ForeignKeyConstraint)�and_)�711Properties)�Protocol)�Engine)�RelationshipDirection)�ORMBackrefArgument)�Relationship)�Column)�MetaData)�Table)�
immutabledict�_KT)�bound�_VTc�.�\rSrSrSSjrSrg)�PythonNameForTableTypei�c��g�N�)�self�base�	tablename�tables    �\D:\code\apps\devtools\python\user_packages\Python313\site-packages\sqlalchemy/ext/automap.py�__call__�PythonNameForTableType.__call__�s���r/N�r1�	Type[Any]r2�strr3r&�returnr:��__name__�712__module__�__qualname__�__firstlineno__r5�__static_attributes__r/r7r4r,r,�s'�����*-��6;��	�r7r,c��[U5$)a$Return the class name that should be used, given the name713of a table.714 715The default implementation is::716 717    return str(tablename)718 719Alternate implementations can be specified using the720:paramref:`.AutomapBase.prepare.classname_for_table`721parameter.722 723:param base: the :class:`.AutomapBase` class doing the prepare.724 725:param tablename: string name of the :class:`_schema.Table`.726 727:param table: the :class:`_schema.Table` object itself.728 729:return: a string class name.730 731 .. note::732 733    In Python 2, the string used for the class name **must** be a734    non-Unicode object, e.g. a ``str()`` object.  The ``.name`` attribute735    of :class:`_schema.Table` is typically a Python unicode subclass,736    so the737    ``str()`` function should be applied to this name, after accounting for738    any non-ASCII characters.739 740)r:)r1r2r3s   r4�classname_for_tablerC�s��D�y�>�r7c�2�\rSrSrSSjrSrg)�NameForScalarRelationshipTypei#c��gr.r/�r0r1�	local_cls�referred_cls�741constraints     r4r5�&NameForScalarRelationshipType.__call__$���r7r/N�742r1r9rHr9rIr9rJrr;r:r<r/r7r4rErE#�7������� �	�743)��744
�
r7rEc�6�URR5$)asReturn the attribute name that should be used to refer from one745class to another, for a scalar object reference.746 747The default implementation is::748 749    return referred_cls.__name__.lower()750 751Alternate implementations can be specified using the752:paramref:`.AutomapBase.prepare.name_for_scalar_relationship`753parameter.754 755:param base: the :class:`.AutomapBase` class doing the prepare.756 757:param local_cls: the class to be mapped on the local side.758 759:param referred_cls: the class to be mapped on the referring side.760 761:param constraint: the :class:`_schema.ForeignKeyConstraint` that is being762 inspected to produce this relationship.763 764�r=�lower�r1rHrIrJs    r4�name_for_scalar_relationshiprS-s��6� � �&�&�(�(r7c�2�\rSrSrSSjrSrg)�!NameForCollectionRelationshipTypeiKc��gr.r/rGs     r4r5�*NameForCollectionRelationshipType.__call__LrLr7r/NrMr<r/r7r4rUrUKrNr7rUc�<�URR5S-$)a�Return the attribute name that should be used to refer from one765class to another, for a collection reference.766 767The default implementation is::768 769    return referred_cls.__name__.lower() + "_collection"770 771Alternate implementations772can be specified using the773:paramref:`.AutomapBase.prepare.name_for_collection_relationship`774parameter.775 776:param base: the :class:`.AutomapBase` class doing the prepare.777 778:param local_cls: the class to be mapped on the local side.779 780:param referred_cls: the class to be mapped on the referring side.781 782:param constraint: the :class:`_schema.ForeignKeyConstraint` that is being783 inspected to produce this relationship.784 785�_collectionrPrRs    r4� name_for_collection_relationshiprZUs��8� � �&�&�(�=�8�8r7c��\rSrSr\SSj5r\SSj5rS	SjrSrg)786�GenerateRelationshipTypeitc��gr.r/�r0r1�	direction�	return_fn�attrnamerHrI�kws        r4r5�!GenerateRelationshipType.__call__us�� r7c��gr.r/r^s        r4r5rc�s��!r7c��gr.r/r^s        r4r5rc�s��8;r7r/N�r1r9r_r!r`z Callable[..., Relationship[Any]]rar:rHr9rIr9rbrr;zRelationship[Any]�r1r9r_r!r`z!Callable[..., ORMBackrefArgument]rar:rHr9rIr9rbrr;r")r1r9r_r!r`�JUnion[Callable[..., Relationship[Any]], Callable[..., ORMBackrefArgument]]rar:rHr9rIr9rbrr;z,Union[ORMBackrefArgument, Relationship[Any]])r=r>r?r@rr5rAr/r7r4r\r\ts��
�	 ��	 �)�	 �4�		 �787�	 ��
	 � �	 ��	 �788�	 ��	 ��	!��	!�)�	!�5�		!�789�	!��
	!� �	!��	!�790�	!��	!�;��;�)�;�791�	;��;��;� �;��;�7926�;r7r\c��gr.r/�r1r_r`rarHrIrbs       r4�generate_relationshiprk�s��r7c��gr.r/rjs       r4rkrk�s��r7c�f�U[La	U"U40UD6$U[La	U"U40UD6$[SU-5e)a'Generate a :func:`_orm.relationship` or :func:`.backref`793on behalf of two794mapped classes.795 796An alternate implementation of this function can be specified using the797:paramref:`.AutomapBase.prepare.generate_relationship` parameter.798 799The default implementation of this function is as follows::800 801    if return_fn is backref:802        return return_fn(attrname, **kw)803    elif return_fn is relationship:804        return return_fn(referred_cls, **kw)805    else:806        raise TypeError("Unknown relationship function: %s" % return_fn)807 808:param base: the :class:`.AutomapBase` class doing the prepare.809 810:param direction: indicate the "direction" of the relationship; this will811 be one of :data:`.ONETOMANY`, :data:`.MANYTOONE`, :data:`.MANYTOMANY`.812 813:param return_fn: the function that is used by default to create the814 relationship.  This will be either :func:`_orm.relationship` or815 :func:`.backref`.  The :func:`.backref` function's result will be used to816 produce a new :func:`_orm.relationship` in a second step,817 so it is critical818 that user-defined implementations correctly differentiate between the two819 functions, if a custom relationship function is being used.820 821:param attrname: the attribute name to which this relationship is being822 assigned. If the value of :paramref:`.generate_relationship.return_fn` is823 the :func:`.backref` function, then this name is the name that is being824 assigned to the backref.825 826:param local_cls: the "local" class to which this relationship or backref827 will be locally present.828 829:param referred_cls: the "referred" class to which the relationship or830 backref refers to.831 832:param \**kw: all additional keyword arguments are passed along to the833 function.834 835:return: a :func:`_orm.relationship` or :func:`.backref` construct,836 as dictated837 by the :paramref:`.generate_relationship.return_fn` parameter.838 839z!Unknown relationship function: %s)rr�	TypeErrorrjs       r4rkrk�sF��x�G����(�R�(�(�	�l�	"���,��,�,��;�i�G�H�Hr7�ByModulePropertiesc
��\rSrSr%SrSrS\S'S\S'S\S	'S840\S'\\R"SS
S9SSSSSSSSSS\R4SSjj55rSr\SSj5r
Srg)�AutomapBasei�a�Base class for an "automap" schema.841 842The :class:`.AutomapBase` class can be compared to the "declarative base"843class that is produced by the :func:`.declarative.declarative_base`844function.  In practice, the :class:`.AutomapBase` class is always used845as a mixin along with an actual declarative base.846 847A new subclassable :class:`.AutomapBase` is typically instantiated848using the :func:`.automap_base` function.849 850.. seealso::851 852    :ref:`automap_toplevel`853 854TzClassVar[Properties[Type[Any]]]�classeszClassVar[ByModuleProperties]�	by_modulezClassVar[MetaData]�metadatazClassVar[_Bookkeeping]�_sa_automapbase_bookkeeping)�2.0z�The :paramref:`_automap.AutomapBase.prepare.engine` parameter is deprecated and will be removed in a future release.  Please use the :paramref:`_automap.AutomapBase.prepare.autoload_with` parameter.)rvz�The :paramref:`_automap.AutomapBase.prepare.reflect` parameter is deprecated and will be removed in a future release.  Reflection is enabled when :paramref:`_automap.AutomapBase.prepare.autoload_with` is passed.)�engine�reflectNFc��URH!nSUR;dM[SU5n
 O	 S5e[5nUcUSnUcUSnU	cUSn	U855cUS	n856Uc[nU(aS857nU(aUnU(aIU(de[US858SS9nU(aUR
U5 URR"U40UD6 [ [R"USS9Vs0sHn[S
UR5U_M snn/nU
RnURRn[U5R!UR"5GH�nUUnUR"R%U5 ['UU5unnnUb!UceUceUR)UUUU45 MXUR*(dMkUU;dMsSU0nUbU"UUR,U5nUbUUS'OSnU"UUR,U5nUc9UUR.;a)[0R2"SUSUR4S35 M�[7UU
4U5n[R8"U5nUR:R<U:XdeUcUUR.U'UR>nUR:R@RCS5H@n U U;a[0RD"05UU 'UU n![GU![D5(deU!nMB UUUR:R<'UUU'GM� URI5Hn[KU
UUUUU	U8595 M UHunnnn[MU
UUUUUUUU	U8605861 M [R"U
5HnURO5 M SSS5 gs snf!,(df   g=f)a�Extract mapped classes and relationships from the862:class:`_schema.MetaData` and perform mappings.863 864For full documentation and examples see865:ref:`automap_basic_use`.866 867:param autoload_with: an :class:`_engine.Engine` or868 :class:`_engine.Connection` with which869 to perform schema reflection; when specified, the870 :meth:`_schema.MetaData.reflect` method will be invoked within871 the scope of this method.872 873:param engine: legacy; use :paramref:`.AutomapBase.autoload_with`.874 Used to indicate the :class:`_engine.Engine` or875 :class:`_engine.Connection` with which to reflect tables with,876 if :paramref:`.AutomapBase.reflect` is True.877 878:param reflect: legacy; use :paramref:`.AutomapBase.autoload_with`.879 Indicates that :meth:`_schema.MetaData.reflect` should be invoked.880 881:param classname_for_table: callable function which will be used to882 produce new class names, given a table name.  Defaults to883 :func:`.classname_for_table`.884 885:param modulename_for_table: callable function which will be used to886 produce the effective ``__module__`` for an internally generated887 class, to allow for multiple classes of the same name in a single888 automap base which would be in different "modules".889 890 Defaults to ``None``, which will indicate that ``__module__`` will not891 be set explicitly; the Python runtime will use the value892 ``sqlalchemy.ext.automap`` for these classes.893 894 When assigning ``__module__`` to generated classes, they can be895 accessed based on dot-separated module names using the896 :attr:`.AutomapBase.by_module` collection.   Classes that have897 an explicit ``__module_`` assigned using this hook do **not** get898 placed into the :attr:`.AutomapBase.classes` collection, only899 into :attr:`.AutomapBase.by_module`.900 901 .. versionadded:: 2.0902 903 .. seealso::904 905    :ref:`automap_by_module`906 907:param name_for_scalar_relationship: callable function which will be908 used to produce relationship names for scalar relationships.  Defaults909 to :func:`.name_for_scalar_relationship`.910 911:param name_for_collection_relationship: callable function which will912 be used to produce relationship names for collection-oriented913 relationships.  Defaults to :func:`.name_for_collection_relationship`.914 915:param generate_relationship: callable function which will be used to916 actually generate :func:`_orm.relationship` and :func:`.backref`917 constructs.  Defaults to :func:`.generate_relationship`.918 919:param collection_class: the Python collection class that will be used920 when a new :func:`_orm.relationship`921 object is created that represents a922 collection.  Defaults to ``list``.923 924:param schema: Schema name to reflect when reflecting tables using925 the :paramref:`.AutomapBase.prepare.autoload_with` parameter. The name926 is passed to the :paramref:`_schema.MetaData.reflect.schema` parameter927 of :meth:`_schema.MetaData.reflect`. When omitted, the default schema928 in use by the database connection is used.929 930 .. note:: The :paramref:`.AutomapBase.prepare.schema`931    parameter supports reflection of a single schema at a time.932    In order to include tables from many schemas, use933    multiple calls to :meth:`.AutomapBase.prepare`.934 935    For an overview of multiple-schema automap including the use936    of additional naming conventions to resolve table name937    conflicts, see the section :ref:`automap_by_module`.938 939    .. versionadded:: 2.0 :meth:`.AutomapBase.prepare` supports being940       directly invoked any number of times, keeping track of tables941       that have already been processed to avoid processing them942       a second time.943 944:param reflection_options: When present, this dictionary of options945 will be passed to :meth:`_schema.MetaData.reflect`946 to supply general reflection-specific options like ``only`` and/or947 dialect-specific options like ``oracle_resolve_synonyms``.948 949 .. versionadded:: 1.4950 951ru�Type[AutomapBase]Fz,Can't locate automap base in class hierarchyNrCrSrZrkT)�schema�extend_existing�autoload_replace)�sortr&�	__table__r>zIgnoring duplicate class name 'z%' received in automap base for table zS without ``__module__`` being set; consider using the ``modulename_for_table`` hook�.)(�__mro__�__dict__r�globals�list�dict�updatertrxrr�classes_for_base�local_tableru�tables�set�952difference�953table_keys�add�_is_many_to_many�append�primary_key�namerrr�warn�key�type�config_for_cls�clsr=rsr>�splitr�954isinstance�values�_relationships_for_fks�_m2m_relationship�map)"r��
autoload_withrwrxr{rC�modulename_for_table�collection_classrSrZrk�reflection_options�mr�automap_base�glbls�opts�m�table_to_map_config�many_to_many�bookkeeping�metadata_tables�	table_keyr3�lcl_m2m�rem_m2m�	m2m_const�clsdict�955new_module�newname�956mapped_cls�957map_config�by_module_properties�token�propss"                                  r4�prepare�AutomapBase.prepareHs+��F�+�+�B�,����;�#�$7��<����958
I�H�H�5��	���&�"'�(=�">��'�/�+0�.�,�(�,�3�/4�2�0�,�!�(�$)�*A�$B�!��#�#����G��"�M�� � �=��� $�!&��D�959"����.�/��L�L� � ��7�$�7�
�/�?�?��e����A��W�a�m�m�,�a�/���
 ��L�&�B�B�K�!�l�l�1�1�O� ��1�<�<��&�&��	�(�	�2���&�&�*�*�9�5�.>�s�E�.J�+���)��&�"�.�.�.�$�0�0�0� �'�'��'�9�e�(L�M��*�*���"5�5�/:�E�.B�G�+�7�%9�����U�&�960�&�1�4>�G�L�1��%)�961�1�#�u�z�z�5�I�G�!�)�g����.D��	�	� � '�y�)B�$�y�y�k�*<�<��!�!%��%���"�J�962"7�!E�!E�"�"�J�&�>�>�2�2�g�=�=�=�!�)�/9����G�,�?B�}�}�(�!+���!:�!:�!@�!@��!E�� �(<�<�:>�/�/�"�:M�0��7� 4�U� ;�� *�%��<�<�<�<�/4�,�"F�EO�(����)@�)@�A�1;�'��.�A�D2�8�8�:�963�&� ��'�$�0�4�)��;�7C�2���)�U�!� �����'�$�0�4�)��7C�4�D�D���964���� ��]�
���	�
�s&�N0�,!N+�
B:N0�GN0�+N0�0965N>c�Z�[R"US[R"U5-S9e)NzClass %s is a subclass of AutomapBase.  Mappings are not produced until the .prepare() method is called on the class hierarchy.)�msg)�orm_exc�UnmappedClassError�_safe_cls_name)r�s r4�_sa_raise_deferred_config�%AutomapBase._sa_raise_deferred_config{s2���(�(��7��$�$�S�)�*�966�	967r7r/)r�rzr�zOptional[Engine]rw�
Optional[Any]rx�boolr{z
Optional[str]rC� Optional[PythonNameForTableType]r�r�r�r�rSz'Optional[NameForScalarRelationshipType]rZz+Optional[NameForCollectionRelationshipType]rkz"Optional[GenerateRelationshipType]r�z.Union[Dict[_KT, _VT], immutabledict[_KT, _VT]]r;�None)r;r968)r=r>r?r@�__doc__�__abstract__�__annotations__�classmethodr�deprecated_params�969EMPTY_DICTr��_sa_decl_preparer�rAr/r7r4rqrq�sG��� �L�
,�,��$,�+��6!� ��"8�7��	���970�971��(+/� $�� $�@D�AE�*.�
�
�DH�
�O�O�%I!�
�I!�'�I!��I!��	I!�972�I!�>�
I!�?�I!�(�I!�'973�I!�+974�I!� B�I!� 975�!I!�&976�'I!�%��&I!�V���(�977��978r7rqc�$�\rSrSr%SrS\S'Srg)�_Bookkeepingi�)r�zSet[str]r�r/N)r=r>r?r@�	__slots__r�rAr/r7r4r�r��s
���I��r7r�c���Uc[S0UD6nOUn[UR[U4S[R979"05[R980"05[
[55S.5$)a�Produce a declarative automap base.981 982This function produces a new base class that is a product of the983:class:`.AutomapBase` class as well a declarative base produced by984:func:`.declarative.declarative_base`.985 986All parameters other than ``declarative_base`` are keyword arguments987that are passed directly to the :func:`.declarative.declarative_base`988function.989 990:param declarative_base: an existing class produced by991 :func:`.declarative.declarative_base`.  When this is passed, the function992 no longer invokes :func:`.declarative.declarative_base` itself, and all993 other keyword arguments are ignored.994 995:param \**kw: keyword arguments are passed along to996 :func:`.declarative.declarative_base`.997 998T)r�rrrsrur/)�_declarative_baser�r=rqrrr�r�)rrb�Bases   r4r�r��sb��,�� �&�2�&������
�
�	�d�� ����r�*�����,�+7���+>�		999�	�	r7c1000��URVs/sHn[U[5(dMUPM nn[U5S:wag[	UVVs/sH)nUR1001Vs/sHoURPM snPM+ snn/5n[U5[UR5:wagUSR1002SRRUSR1003SRRU4$s snfs snfs snnf)Nr)NNNr�)�constraintsr�r�len�sum�elements�parentr��c�columnr3)r�r3�const�fk_constraints�
fk_constraint�fk�colss       r4r�r��s���&�&��&�E��e�1�2�	�&���1004�>��a���!�"0�	1005�!/�
�"/�!7�!7�8�!7�2�Y�Y�!7�8�!/�	1006�	��D��4�y�C����L� ��	�q��"�"�1�%�,�,�2�2��q��"�"�1�%�,�,�2�2�����'��
9��	1007s"�C7�C7�D1008�"C<�7D1009�<D1010c���[SUR5n[SUR5nUbUcgURGH�n	[	U	[10115(dMU	Rn1012U1013SRRnURUS5nUcMWURn
X�La[X�5(aMyU"XX�5nU"X
X�5n0nSU1014Vs1sHnURRiM sn;nU(d:SUS'U	R(a#U	RR5S:XaSUS'O4U	R(a#U	RR5S	:XaSUS'X�R;nX�R;a�U(a#U"U[ R"[$UU
U4S1015U0UD6nOSnU"U[ R&[(UUU
U	RVs/sHnURPM snUU	RVs/sHnURPM snS9	nUb0UURU'U(dUURUlGMGMGMU(dGMU"U[ R"[(UU
U4U	RVs/sHnURPM snUUS.UD6nUcGMnUURU'UURUlGM� gs snfs snfs snfs snf)
NzOptional[Table]�Optional[Type[Any]]rFzall, delete-orphan�cascadeT�passive_deleteszset nullr�)�foreign_keysr�remote_side)r��back_populatesr�)rr�r�r�r�rr�r�r3�get�1016issubclassr��nullable�ondeleterQ�1017propertiesr�	ONETOMANYr�	MANYTOONErr�)r�r�r�r�rSrZrkr�rHrJ�fks�referred_table�referred_cfgrI�relationship_name�backref_name�o2m_kwsr�r��create_backref�backref_obj�rels                      r4r�r��s���(�*�*@�*@�A�K���z�~�~��I���i�/��!�-�-�1018��j�"6�7�7��%�%�C� ��V�]�]�0�0�N�.�2�2�>�4�H�L��#��'�+�+�L��,���2�2�� <���!��<��I��L�46�G��#�$F�#�B�R�Y�Y�%7�%7�#�$F�F�H��%9��	�"��'�'�"�+�+�1�1�3�y�@�15�G�-�.���'�'�"�+�+�1�1�3�z�A�15�G�-�.�)�1H�1H�H�N� �(=�(=�=�!�"7�$�"�,�,��$�$�!�
	#�*:�	#�"�	#�K�#'�K�+� ��(�(� �%�� �6@�6I�6I�!J�6I��"�)�)�6I�!J�'�5?�5H�5H� I�5H�r����5H� I�1019���?�?B�J�)�)�*;�<�)�,=�%�/�/�(��(�*�#� ��+� ��(�(� � � ��
�7A�6I�6I�!J�6I��"�)�)�6I�!J�#4�%5������?�<?�L�+�+�L�9�(4��)�)�)��$�q.��,%G��N"K�� I�� "Ks� K�K�K!�K&c1020��URUS5n1021URUS5nU1022bUcgU1023RnURn
U"XX�S5nU"X
X�S5nX�R;nXE;aSnOSnX�R;a�U(a U	"U[R[1024UU
UUUS9nOSnU	"U[R[UUU
UU[SUSR55[SUSR55UUS9nUb,UU1025RU'U(dUURUl	gggU(a�U	"U[R[UU
UUU[SUSR55[S	USR55UUS10269nUb$UURU'UU1027RUl	ggg)Nrr�z__*)r��overlapsc3�R# �UHoRUR:Hv� M g7fr.�r�r���.0r�s  r4�	<genexpr>�$_m2m_relationship.<locals>.<genexpr>~�����1F�2�	�	�R�Y�Y�&�1F���%'c3�R# �UHoRUR:Hv� M g7fr.r�r�s  r4r�r�������1F�2�	�	�R�Y�Y�&�1F�r�)r��	secondary�primaryjoin�
secondaryjoinrr�c3�R# �UHoRUR:Hv� M g7fr.r�r�s  r4r�r��r�r�c3�R# �UHoRUR:Hv� M g7fr.r�r�s  r4r�r��rr�)r�rrrr�r�)1028r�r�r�r�1029MANYTOMANYrrrr�r�)r�r�r�r�r3r�r�rSrZrkr�r�rHrIr�r�r�r�r�r�s                    r4r�r�As2��%�(�(��$�7�J�&�*�*�7�D�9�L���\�1�����I��#�#�L�8����|���4��I��|��L�"�)@�)@�@�N��#������ 5� 5�5��/���%�%�����!1�!�	�K��K�#���!�!���������1:�1��1F�1F�����1:�1��1F�1F��� �-�!1030��$�?�7:�J�!�!�"3�4�!�$5��'�'� �� �"��1031�#���!�!���������1:�1��1F�1F�����1:�1��1F�1F���-�-�!1032��$�?�47�L�#�#�L�1� ,�
�!�!�!�
��	�'1033r7r8rMrfrg)r1r9r_r!r`rhrar:rHr9rIr9rbrr;z,Union[Relationship[Any], ORMBackrefArgument]r.)rr�rbrr;r)r�r9r3r&r;zMTuple[Optional[Table], Optional[Table], Optional[list[ForeignKeyConstraint]]])r�r9r�rr��WUnion[Dict[Optional[Table], _DeferredMapperConfig], Dict[Table, _DeferredMapperConfig]]r�r�rSrErZrUrkr\r;r�)r�r9r�r&r�r&r�zList[ForeignKeyConstraint]r3r&r�rr�r�rSrUrZrUrkr\r;r�)Gr��1034__future__r�dataclasses�typingrrrrrr	r1035rrr
rrrrr�r�ormrrr�rr�rr�
orm.decl_baser�1036orm.mapperrr{r�sqlrr�util.typingr�engine.baser �orm.baser!�orm.relationshipsr"r#�1037sql.schemar$r%r&r'r(r*r,rCrErSrUrZr\rkrorq�	dataclassr�r�r�r�r�r/r7r4�<module>rs���@�B#�������������� �����7� ���1�)�)���"��$�0�6�0�#�%�"�$��e�3���
�e�3����X��"�1038�"��"��"�	�	"�J�H��)�1039�)��)��)�%�	)�1040	�)�<���9�1041�9��9��9�%�	9�1042	�9�>$;�x�$;�N1043��1044��$��0���	�1045���
�����1046��1047��1048��$��1���	�1049���
�����1050��AI�1051�AI�$�AI��AI��
AI��AI��AI��AI�2�AI�H ��&:�D��I�&E� F�G��I1052�I1053�X
�������-1�$�)�$�8;�$��$�N���$)����>k4��k4�%�k4��k4��k4�#@�k4�'H�k4�4�k4�1054�k4�\d,��d,�
�d,��d,�*�	d,�1055�d,��
d,��d,�#D�d,�'H�d,�4�d,�1056�d,r7
codekingpro/portable-devtools · Team Ai