U of @sDddlmZddlmZddlmZddlmZGdddeZdS) ) Requirements)util) sqla_compat) exclusionsc@seZdZeddZeddZeddZeddZed d Zed d Z ed dZ eddZ eddZ eddZ eddZeddZeddZeddZeddZedd Zed!d"Zed#d$Zed%d&Zed'd(Zed)d*Zed+d,Zed-d.Zed/d0Zed1d2Zed3d4Zed5d6Zed7d8Zed9d:Z ed;d<Z!ed=d>Z"ed?d@Z#edAdBZ$edCdDZ%edEdFZ&edGdHZ'edIdJZ(dKS)LSuiteRequirementscCstS)zXTarget database must support external schemas, and have one named 'test_schema'.ropenselfr J/opt/hc_python/lib/python3.8/site-packages/alembic/testing/requirements.pyschemas szSuiteRequirements.schemascCstS)z;target database should support 'AUTOCOMMIT' isolation levelrclosedr r r r autocommit_isolationsz&SuiteRequirements.autocommit_isolationcCstS)zneeded for sqlalchemy compatrr r r r materialized_viewssz$SuiteRequirements.materialized_viewscCsdd}t|S)NcSsfddlm}||j}z|dWn<tk r:YdStk rNYdStk r`YnXdS)Nr)inspectxTF)Z sqlalchemyrdbZget_unique_constraintsNotImplementedError TypeError Exception)configrZinspr r r doesnt_have_check_uq_constraintss  zXSuiteRequirements.unique_constraint_reflection..doesnt_have_check_uq_constraintsrZskip_if)r rr r r unique_constraint_reflectionsz.SuiteRequirements.unique_constraint_reflectioncCstddgdS)z'Target database must support SEQUENCEs.cSs |jjjSN)rdialectZsupports_sequencesrr r r 2z-SuiteRequirements.sequences..zno sequence supportronly_ifr r r r sequences-szSuiteRequirements.sequencescCstSrrr r r r foreign_key_match6sz#SuiteRequirements.foreign_key_matchcCstSrrr r r r !foreign_key_constraint_reflection:sz3SuiteRequirements.foreign_key_constraint_reflectioncCstS)zMTarget database must support check constraints and also enforce them.rr r r r check_constraints_w_enforcement>sz1SuiteRequirements.check_constraints_w_enforcementcCstSrrr r r r reflects_pk_namesEsz#SuiteRequirements.reflects_pk_namescCstSrrr r r r reflects_fk_optionsIsz%SuiteRequirements.reflects_fk_optionscCstdddS)NcSstj Sr)rZsqla_14rr r r r Pr!z1SuiteRequirements.sqlalchemy_14..z"SQLAlchemy 1.4 or greater requiredrr r r r sqlalchemy_14MszSuiteRequirements.sqlalchemy_14cCstdddS)NcSstjSrrZsqla_2rr r r r Wr!z1SuiteRequirements.sqlalchemy_1x..zSQLAlchemy 1.x testrr r r r sqlalchemy_1xTszSuiteRequirements.sqlalchemy_1xcCstdddS)NcSstj Srr+rr r r r ^r!z0SuiteRequirements.sqlalchemy_2..zSQLAlchemy 2.x testrr r r r sqlalchemy_2[szSuiteRequirements.sqlalchemy_2cCsdd}|jt|S)NcSs,z ddl}Wntk r"YdSXdSdS)NrFT)greenlet ImportError)rr.r r r gods  z%SuiteRequirements.asyncio..go)r*rr#)r r0r r r asynciobszSuiteRequirements.asynciocCstddS)NcSs |jjjSr)rrZsupports_commentsrr r r r qr!z,SuiteRequirements.comments..r"r r r r commentsnszSuiteRequirements.commentscCstSrrr r r r alter_columntszSuiteRequirements.alter_columncCstSrrr r r r computed_columnsxsz"SuiteRequirements.computed_columnscCstttjSr)rr#BooleanPredicaterZ has_computedr r r r computed_columns_api|s z&SuiteRequirements.computed_columns_apicCstttjSr)rr#r5rZhas_computed_reflectionr r r r computed_reflects_normallys z,SuiteRequirements.computed_reflects_normallycCstSrrr r r r #computed_reflects_as_server_defaultsz5SuiteRequirements.computed_reflects_as_server_defaultcCstSrrr r r r )computed_doesnt_reflect_as_server_defaultsz;SuiteRequirements.computed_doesnt_reflect_as_server_defaultcCstSrrr r r r autoincrement_on_composite_pksz/SuiteRequirements.autoincrement_on_composite_pkcCstSrrr r r r fk_ondelete_is_reflectedsz*SuiteRequirements.fk_ondelete_is_reflectedcCstSrrr r r r fk_onupdate_is_reflectedsz*SuiteRequirements.fk_onupdate_is_reflectedcCstSrrr r r r fk_onupdateszSuiteRequirements.fk_onupdatecCstSrrr r r r fk_ondelete_restrictsz&SuiteRequirements.fk_ondelete_restrictcCstSrrr r r r fk_onupdate_restrictsz&SuiteRequirements.fk_onupdate_restrictcCstSrrr r r r fk_ondelete_noactionsz&SuiteRequirements.fk_ondelete_noactioncCstSrrr r r r fk_initiallyszSuiteRequirements.fk_initiallycCstSrrr r r r fk_deferrableszSuiteRequirements.fk_deferrablecCstSrrr r r r fk_deferrable_is_reflectedsz,SuiteRequirements.fk_deferrable_is_reflectedcCstSrrr r r r fk_namesszSuiteRequirements.fk_namescCstSrrr r r r integer_subtype_comparisonssz-SuiteRequirements.integer_subtype_comparisonscCstddS)NcSs |jjjSr)rrZrequires_name_normalizerr r r r r!z5SuiteRequirements.no_name_normalize..rr r r r no_name_normalizesz#SuiteRequirements.no_name_normalizecCstSrrr r r r identity_columnssz"SuiteRequirements.identity_columnscCstSrrr r r r identity_columns_altersz(SuiteRequirements.identity_columns_altercCstttjSr)rr#r5rZ has_identityr r r r identity_columns_apis z&SuiteRequirements.identity_columns_apiN))__name__ __module__ __qualname__propertyrrrrr$r%r&r'r(r)r*r,r-r1r2r3r4r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIr r r r rs                                    rN) Zsqlalchemy.testing.requirementsralembicrZ alembic.utilrZtestingrrr r r r s