mò ž%ÜGc@sOdZdklZlZlZlZdkZdkZdkZdkZddddddd d d d d dddddddgZ de fd„ƒYZ d„Z de fd„ƒYZde eifd„ƒYZde eifd„ƒYZde fd„ƒYZd e fd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZde fd „ƒYZd efd!„ƒYZd efd"„ƒYZd efd#„ƒYZd efd$„ƒYZde fd%„ƒYZde fd&„ƒYZdefd'„ƒYZdefd(„ƒYZ dei!fd)„ƒYZ"e d*ƒZ#dS(+s+the schema module provides the building blocks for database metadata. This means all the entities within a SQL database that we might want to look at, modify, or create and delete are described by these objects, in a database-agnostic way. A structure of SchemaItems also provides a "visitor" interface which is the primary method by which other methods operate upon the schema. The SQL package extends this structure with its own clause-specific objects as well as the visitor interface, so that the schema package "plugs in" to the SQL package. (ssqlstypess exceptionssutilNt SchemaItemtTabletColumnt ForeignKeytSequencetIndextForeignKeyConstrainttPrimaryKeyConstrainttCheckConstrainttUniqueConstrainttDefaultGeneratort ConstrainttMetaDatat BoundMetaDatatDynamicMetaDatat SchemaVisitortPassiveDefaultt ColumnDefaultcBs˜tZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z dd „Z dd „Z d „Z e e ƒZe d „ƒZe d „ƒZRS(s3base class for items that define a database schema.cGs3x,|D]$}|dj o|i|ƒqqWdS(s6initialize the list of child items for this SchemaItemN(targstitemtNonet _set_parenttself(RRR((t5/home/holguin2/public_html/spyce/sqlalchemy/schema.pyt _init_itemss  cCs tƒ‚dS(N(tNotImplementedError(R((Rt _get_parent scCs tƒ‚dS(s/associate with this SchemaItem's parent object.N(R(Rtparent((RR"scCsd|iiS(Ns%s()(Rt __class__t__name__(R((Rt__repr__%scCsdS(s3return the the MetaData to which this item is boundN(R(R((Rt_derived_metadata'scCs |iƒiS(s&return the engine or None if no engineN(RRtengine(R((Rt _get_engine*scCs4|iƒ}|dj o|Sntidƒ‚dS(s0return the engine or raise an error if no engines.This SchemaItem is not connected to any EngineN(RR!teRt exceptionstInvalidRequestError(RR"((Rt get_engine-s   tcase_sensitivecCs$t|d||i|dƒƒdS(sËset the "case_sensitive" argument sent via keywords to the item's constructor. for the purposes of Table's 'schema' property, the name of the variable is optionally configurable.s _%s_settingN(tsetattrRtkeynametkwargstpopR(RtnameR)R(((Rt_set_casing_strategy5scCs§t|d|dƒ}|dj o|Sn|}xV|dj oH|iƒ}|dj o+t|ddƒ}|dj o|Sq…q4q4W|dj o|i ƒ|jS(s.determine the "case_sensitive" value for this item. for the purposes of Table's 'schema' property, the name of the variable is optionally configurable. a local non-None value overrides all others. after that, the parent item (i.e. Column for a Sequence, Table for a Column, MetaData for a Table) is searched for a non-None setting, traversing each parent until none are found. finally, case_sensitive is set to True if and only if the name of this item is not all lowercase. s _%s_settingt_case_sensitive_settingN( tgetattrRR(RtlocalRRt parentvalR+tlower(RR+R(RR0R/((Rt_determine_case_sensitive;s      cCsAy |iSWn/tj o#|i|iƒ|_|iSnXdS(N(Rt_SchemaItem__case_sensitivetAttributeErrorR2R+(R((Rt_get_case_sensitiveRs  cCs |iƒS(N(tsR!(R6((RtZscCs |iƒS(N(R6R(R6((RR7[s(Rt __module__t__doc__RRRRRR!R%R,R2R5tpropertyR&R tmetadata(((RRs            cCs%|djo|Sn |d|SdS(Nt.(tschemaRR+(R+R=((Rt_get_table_key]s t_TableSingletoncBstZdZd„ZRS(sCa metaclass used by the Table object to provide singleton behavior.c Os7t|tiƒo6|} t| dƒpt| ƒ| _n| i}nE|dj o7t|t ƒ o&t |ƒ}|i d|ƒd}n|djo t }nt|ƒ}|iddƒ} |idtƒ}|idtƒ} |idtƒ}|idtƒ}t|| ƒ} yJ|i| }t|ƒo(|ptid| |fƒ‚q^n|SWnÍt j oÁ|otid | |fƒ‚nt!i"||||}|i$|ƒ|oYy/| o| i%|ƒn|i&ƒi%|ƒWqti'j o|i| =‚qXn|i(|Œ|SnXdS( Nt_legacy_metadataiR=tautoloadt autoload_witht mustexistt useexistings<Table '%s.%s' is already defined for this MetaData instance.sTable '%s.%s' not defined()t isinstanceR;tsqltExecutorR thasattrR R@RR tlistRtinserttdefault_metadatatstrR+R)tgetR=R*tFalseRARBRCRDR>tkeyttablesttabletlenR#t ArgumentErrortKeyErrorttypet__call__RRt reflecttableR%tNoSuchTableErrorR( RR+R;RR)RCRARQRDR=R RORB((RRVesN        !    (RR8R9RV(((RR?cs cBsÎtZdZeZd„Zd„ZeeƒZd„Z ed„e ƒZ d„Z d„Z d„Z d„Zd „Zd „Zd „Zed „Zed „Zeed„Zeed„Zed„ZRS(sfrepresents a relational database table. This subclasses sql.TableClause to provide a table that is "wired" to an engine. Whereas TableClause represents a table as its used in a SQL expression, Table represents a table as its created in the database. Be sure to look at sqlalchemy.sql.TableImpl for additional methods defined on a Table.cKstt|ƒi|ƒ||_|idd ƒ|_ t i ƒ|_ t i ƒ|_tƒ|_|idtƒ|_|idtƒ|_|i d j od|i |if|_n |i|_|idd ƒ|_|i||ƒ|i|i pd|ddƒ||_d S( sõ Construct a Table. Table objects can be constructed directly. The init method is actually called via the TableSingleton metaclass. Arguments are: name : the name of this table, exactly as it appears, or will appear, in the database. This property, along with the "schema", indicates the "singleton identity" of this table. Further tables constructed with the same name/schema combination will return the same Table instance. *args : should contain a listing of the Column objects for this table. **kwargs : options include: schema=None : the "schema name" for this table, which is required if the table resides in a schema other than the default selected schema for the engine's database connection. autoload=False : the Columns for this table should be reflected from the database. Usually there will be no Column objects in the constructor if this property is set. mustexist=False : indicates that this Table must already have been defined elsewhere in the application, else an exception is raised. useexisting=False : indicates that if this Table was already defined elsewhere in the application, disregard the rest of the constructor arguments. If this flag and the "redefine" flag are not set, constructing the same table twice will result in an exception. owner=None : optional owning user of this table. useful for databases such as Oracle to aid in table reflection. quote=False : indicates that the Table identifier must be properly escaped and quoted before being sent to the database. This flag overrides all other quoting behavior. quote_schema=False : indicates that the Namespace identifier must be properly escaped and quoted before being sent to the database. This flag overrides all other quoting behavior. case_sensitive=True : indicates that the identifier should be interpreted by the database in the natural case for identifiers. Mixed case is not sufficient to cause this identifier to be quoted; it must contain an illegal character. case_sensitive_schema=True : indicates that the identifier should be interpreted by the database in the natural case for identifiers. Mixed case is not sufficient to cause this identifier to be quoted; it must contain an illegal character. R=tquotet quote_schemas%s.%stownertR(tcase_sensitive_schemaN(tsuperRRt__init__R+R;t _metadataR)R*RR=tutiltSettindexest constraintsRt primary_keyRMRNRYRZtfullnameR[R,(RR+R;R)((RR_¡s *    cCsayt|dƒSWnItj o=t|d|i|ipdddƒƒt|dƒSnXdS(Nt_case_sensitive_schemaR\R(R](R.RR4R'R2R=(R((Rt_get_case_sensitive_schemaÞs )cCsPt|ddƒ|ijo|ii|iƒn||_|ii|ƒdS(Nt _primary_key(R.RRRdtremoveRitpktadd(RRk((Rt_set_primary_keyæs cCs|iS(N(R6Ri(R6((RR7ëscCs|iS(N(RR`(R((RRísc Cs“dtit|iƒgt|iƒgg}|iD]}|t|ƒq6~g}dgD]&}|d|tt ||ƒƒfq^~dƒS(Ns Table(%s)R=s%s=%ss, ( tstringtjointreprRR+R;t_[1]tcolumnstxtkR.(RRqRsRt((RRïs‹cCst|i|iƒS(N(R>RR+R=(R((Rt__str__öscCs|i|ƒdS(sappend a Column to this Table.N(tcolumnRR(RRv((Rt append_columnùscCs|i|ƒdS(s"append a Constraint to this Table.N(t constraintRR(RRx((Rtappend_constraintüscCs|iS(N(RR`(R((RRscCs)||it|i|iƒ<||_dS(N(RR;RPR>R+R=R`(RR;((RRscCs<|o(x%|iD]}|i|tƒqWn|i|ƒS(N(ttraverseRRrtctaccept_schema_visitortvisitortTruet visit_table(RR}RzR{((RR|s  cs6|djoˆiƒ}n‡d†}|i|ƒS(s!return True if this table exists.cs|i}|ii|ˆiƒS(N(tconnR R"tdialectt has_tableRR+(R€R"(R(Rtdos N(t connectableRRR%Rƒt run_callable(RR„Rƒ((RRtexists s   cCs&|iid|d|d|gƒdS(sYissue a CREATE statement for this table. see also metadata.create_all().R„t checkfirstRPN(RR;t create_allR„R‡(RR„R‡((RtcreatescCs&|iid|d|d|gƒdS(sUissue a DROP statement for this table. see also metadata.drop_all().R„R‡RPN(RR;tdrop_allR„R‡(RR„R‡((RtdropscCsÂy;|djo |i}nt|i|ƒ}|i|SWn€tj otg}x$|i D]}|i |i ƒƒq\Wx$|iD]}|i |i ƒƒqƒWt|i|d||ŒSnXdS(sAreturn a copy of this Table associated with a different MetaData.R=N(R=RRR>R+ROR;RPRTRRrR{tappendtcopyRdR(RR;R=R{RRO((Rt tometadatas    (RR8R9R?t __metaclass__R_RhR:R]RmReRRRuRwRyRRR~R|RR†RNR‰R‹RŽ(((RR™s&  =            cBs¹tZdZd„ZeidƒZeidƒZed„ƒZ d„Z d„Z d„Z d„Z d „Zd „Zd „Zd „Zed „Zd„ZeeƒZed„ZRS(s¸represents a column in a database table. this is a subclass of sql.ColumnClause and represents an actual existing table in the database, in a similar fashion as TableClause/Table.cOsrt|ƒ}tt|ƒi|d |ƒ||_|i d|ƒ|_ |i dt ƒ|_ |i d|i ƒ|_|i dt ƒ|_|i dd ƒ|_|i dd ƒ|_|i dd ƒ|_|i dt ƒ|_|i||ƒ|i d d ƒ|_|i d tƒ|_tiƒ|_||_tiƒ|_t|ƒo#t i!d t"|i#ƒƒƒ‚nd S( sÉconstructs a new Column object. Arguments are: name : the name of this column. this should be the identical name as it appears, or will appear, in the database. type: the TypeEngine for this column. This can be any subclass of types.AbstractType, including the database-agnostic types defined in the types module, database-specific types defined within specific database modules, or user-defined types. *args: Constraint, ForeignKey, ColumnDefault and Sequence objects should be added as list values. **kwargs : keyword arguments include: key=None : an optional "alias name" for this column. The column will then be identified everywhere in an application, including the column list on its Table, by this key, and not the given name. Generated SQL, however, will still reference the column by its actual name. primary_key=False : True if this column is a primary key column. Multiple columns can have this flag set to specify composite primary keys. As an alternative, the primary key of a Table can be specified via an explicit PrimaryKeyConstraint instance appended to the Table's list of objects. nullable=True : True if this column should allow nulls. Defaults to True unless this column is a primary key column. default=None : a scalar, python callable, or ClauseElement representing the "default value" for this column, which will be invoked upon insert if this column is not present in the insert list or is given a value of None. The default expression will be converted into a ColumnDefault object upon initialization. _is_oid=False : used internally to indicate that this column is used as the quasi-hidden "oid" column index=False : Indicates that this column is indexed. The name of the index is autogenerated. to specify indexes with explicit names or indexes that contain multiple columns, use the Index construct instead. unique=False : Indicates that this column contains a unique constraint, or if index=True as well, indicates that the Index should be created with the unique flag. To specify multiple columns in the constraint/index or to specify an explicit name, use the UniqueConstraint or Index constructs instead. autoincrement=True : Indicates that integer-based primary key columns should have autoincrementing behavior, if supported by the underlying database. This will affect CREATE TABLE statements such that they will use the databases "auto-incrementing" keyword (such as SERIAL for postgres, AUTO_INCREMENT for mysql) and will also affect the behavior of some dialects during INSERT statement execution such that they will assume primary key values are created in this manner. If a Column has an explicit ColumnDefault object (such as via the "default" keyword, or a Sequence or PassiveDefault), then the value of autoincrement is ignored and is assumed to be False. autoincrement value is only significant for a column with a type or subtype of Integer. quote=False : indicates that the Column identifier must be properly escaped and quoted before being sent to the database. This flag should normally not be required as dialects can auto-detect conditions where quoting is required. case_sensitive=True : indicates that the identifier should be interpreted by the database in the natural case for identifiers. Mixed case is not sufficient to cause this identifier to be quoted; it must contain an illegal character. RORetnullablet_is_oidtdefaulttindextuniqueRYtonupdatet autoincrements$Unknown arguments passed to Column: N($RLR+R^RRR_RRURR)R*RORNRiReRR‘R’R“R”RYR,R•R~R–RaRbRdt_Column__originating_columnt OrderedSett _foreign_keysRRR#RSRptkeys(RR+RURR)((RR_1s(8    RiR™cCs|gS(N(R(R((RR7€scCsV|idj o;|iiƒo|iid|iSn|iS|iSn|iSdS(NR<(RRQRtnamed_with_columnR+(R((RRu‚s  cCs |iiS(N(RRQR;(R((RRŒscCs |iiS(N(RRQR (R((RR!ŽscCs|i|ƒdS(N(tfkRR(RRœ((Rtappend_foreign_key‘sc Cs°dtit|iƒgt|iƒgg}|iD]$}|dj o|t|ƒq6q6~g}dddddgD]&}|d|tt ||ƒƒfq{~dƒS( Ns Column(%s)ROReRR’R•s%s=%st,( RnRoRpRR+RURqt foreign_keysRsRRtR.(RRqRsRt((RR”s¨cCs|iS(N(RRQ(R((RR›scCst|ddƒdj otidƒ‚n|ip|ii|ƒn|i o|i i|ƒn||_|i oGt |i t ƒotidƒ‚nt d|i|d|iƒnK|io@t |it ƒotidƒ‚n|it|iƒƒnt|iƒ}|idj o|it|iƒƒn|idj o |it|idtƒƒn|i|Œd|_dS(NRQs this Column already has a table!s¡The 'index' keyword argument on Column is boolean only. To create indexes with a specific name, append an explicit Index object to the Table's list of elements.six_%sR”sÌThe 'unique' keyword argument on Column is boolean only. To create unique constraints or indexes with a specific name, append an explicit UniqueConstraint or Index object to the Table's list of elements.t for_update(R.RRR#RSR‘RQt_columnsRlReR“RERLRt_labelR”RyR RORIRttoinitR’RŒRR•R~R(RRQR£((RRžs,    !   cCsOt|i|i|id|id|id|id|id|i d|i ƒS(sNcreates a copy of this Column, unitialized. this is used in Table.tometadata.ROReRR‘R&RYN( RRR+RUR’ROReRR‘R-RY(R((RR¸scCsg}|iD]}|t|iƒq~}t|p|i|i |i d|p|i d|i d|i d|id|i|Œ}||_|i|_|i|_|ip2|ii|ƒ|i o|i i|ƒqãng}|D]}||i|ƒqî~|S(s¡create a "proxy" for this column. This is a copy of this Column referenced by a different parent (such as an alias or select statement)ROReRR‘RYN(RqRRŸtfRt_colspecRœRR+RUR’ROReRR‘RYR{t selectableRQtorig_setR—RrRlR(RR¦R+R{R¤RqRœ((Rt _make_proxy¼s-Y     (cCs |iiƒS(shredirect the 'case_sensitive' accessor to use the ultimate parent column which created this one.N(RR—R5(R((Rt _case_sensÍscCs¾|o¦|idj o|ii|dtƒn|idj o|ii|dtƒnx$|iD]}|i|dtƒqeWx(|i D]}|i|dtƒqŒWn|i |ƒdS(s|traverses the given visitor to this Column's default and foreign key object, then calls visit_column on the visitor.RzN( RzRR’RR|R}R~R•RŸR¤RdRxt visit_column(RR}RzR¤Rx((RR|Ós  (RR8R9R_RatSimplePropertyReRŸR:RrRuRR!RRRRRRR¨R©R&R~R|(((RR.s"  M          cBsztZdZeeed„Zd„Zd„Zd„Zd„Z d„Z e d„ƒZ e d„Zd „Zd „ZRS( sdefines a column-level ForeignKey constraint between two columns. ForeignKey is specified as an argument to a Column object. One or more ForeignKey objects are used within a ForeignKeyConstraint object which represents the table-level constraint definition.cCsQt|tƒot|ƒ}n||_d|_||_||_ ||_ dS(sËConstruct a new ForeignKey object. "column" can be a schema.Column object representing the relationship, or just its string name given as "tablename.columnname". schema can be specified as "schema.tablename.columnname" "constraint" is the owning ForeignKeyConstraint object, if any. if not given, then a ForeignKeyConstraint will be automatically created and added to the parent table. N( RERvtunicodeRLRR¥Rt_columnRxt use_alterR+(RRvRxR®R+((RR_és     cCsdt|iƒƒS(NsForeignKey(%s)(RpRt _get_colspec(R((RRûscCst|iƒƒS(s)produce a copy of this ForeignKey object.N(RRR¯(R((RRþscCs‚t|itƒo |iSna|iiidj o-d|iii|iii|iifSnd|iii|iifSdS(Ns%s.%s.%ss%s.%s( RERR¥RLRQR=RR+RO(R((RR¯s  -cCs|i|itƒdj S(sAreturns True if the given table is referenced by this ForeignKey.N(RQtcorresponding_columnRRvRNR(RRQ((Rt references sc Csù|idjo¶t|itƒo“xN|iiD]$}t|t ƒo|i }Pq0q0Wt i dt|iƒƒ‚tid|iƒ}|djot i d|iƒ‚n|idƒdjo%|iddƒ\}}|i} n|idddƒ\} }}t||idtd| ƒ}yD|djo#|i}|i|ii|_n|i||_WqÂtj o8}t i d |i|i|i|id fƒ‚qÂXqÆ|i|_n|iitijo|ii|i_n|iS( Ns@Parent column '%s' does not descend from a table-attached Columns+^([\w_-]+)(?:\.([\w_-]+))?(?:\.([\w_-]+))?$s*Invalid foreign key column specification: iiiRCR=sSCould not create ForeignKey '%s' on table '%s': table '%s' has no column named '%s'i( RR­RRER¥RLRR§R{RRQt parenttableR#RStretmatchtmtgroupttnametcolnameR=RR;R~RORTR"R+RRUttypestNULLTYPE( RR{R"ROR¸R·RµR²RQR=((Rt _init_columns6       8cCs |iƒS(N(R6R»(R6((RR74scCs|i|ƒdS(s8calls the visit_foreign_key method on the given visitor.N(R}tvisit_foreign_keyR(RR}Rz((RR|6scCs|iS(N(RR(R((RR:scCsª||_|idjodt|iitƒoNtggd|i d|i ƒ|_|iii |iƒ|ii |ƒn|ii i|ƒ|iii i|ƒdS(NR®R+(RvRRRxRRERQRRR®R+Ryt _append_fkRŸRl(RRv((RR<s &$(RR8R9RRNR_RRR¯R±R»R:RvR~R|RR(((RRâs      &  cBsJtZdZeed„Zd„Zd„Zd„Zd„Z d„Z RS(s'Base class for column "default" values.cCs||_||_dS(N(R RR;R`(RR R;((RR_Is cCs2y|iiiSWntj o|iSnXdS(N(RRvRQR;R4R`(R((RRLscCst|ddƒS(NRv(R.RR(R((RRQscCsE||_|iii|_|io||i_n ||i_dS(N(RvRRQR;R`R R•R’(RRv((RRSs   cKs|iƒi||S(N(RR%texecute_defaultR)(RR)((RtexecuteZscCsdS(NsDefaultGenerator()((R((RR\s( RR8R9RNRR_RRRR¿R(((RR Gs     cBs,tZdZd„Zed„Zd„ZRS(s0a default that takes effect on the database sidecKs#tt|ƒi|||_dS(N(R^RRR_R)targ(RRÀR)((RR_ascCs |i|ƒS(N(R}tvisit_passive_defaultR(RR}Rz((RR|dscCsdt|iƒS(NsPassiveDefault(%s)(RpRRÀ(R((RRfs(RR8R9R_R~R|R(((RR_s   cBs,tZdZd„Zed„Zd„ZRS(ssA plain default value on a column. this could correspond to a constant, a callable function, or a SQL clause.cKs#tt|ƒi|||_dS(N(R^RRR_R)RÀ(RRÀR)((RR_lscCs,|io|i|ƒSn|i|ƒSdS(s;calls the visit_column_default method on the given visitor.N(RR R}tvisit_column_onupdatetvisit_column_default(RR}Rz((RR|os cCsdt|iƒS(NsColumnDefault(%s)(RpRRÀ(R((RRus(RR8R9R_R~R|R(((RRis   cBsStZdZeeeed„Zd„Zd„Zd„Zd„Z e d„Z RS(sFrepresents a sequence, which applies to Oracle and Postgres databases.cKsWtt|ƒi|||_||_||_||_||_ |i ||ƒdS(N( R^RRR_R)R+tstartt incrementtoptionalRYR,(RR+RÄRÅRÆRYR)((RR_zs     c Csadtit|iƒgg}dddgD]&}|d|tt||ƒƒfq,~dƒS(Ns Sequence(%s)RÄRÅRÆs%s=%sRž(RnRoRpRR+RqRtR.(RRtRq((RR‚sYcCs#tt|ƒi|ƒ||_dS(N(R^RRRRvtsequence(RRv((RR‡scCs|iƒi|ƒ|S(N(RR%R‰(R((RR‰ŠscCs|iƒi|ƒdS(N(RR%R‹(R((RR‹scCs |i|ƒS(s5calls the visit_seauence method on the given visitor.N(R}tvisit_sequenceR(RR}Rz((RR|s( RR8R9RRNR_RRR‰R‹R~R|(((RRxs     cBsYtZdZed„Zd„Zd„Zd„Zd„Zd„Z d„Z d„Z RS( sËrepresents a table-level Constraint such as a composite primary key, foreign key, or unique constraint. Implements a hybrid of dict/setlike behavior with regards to the list of underying columnscCs||_tiƒ|_dS(N(R+RRFtColumnCollectionRr(RR+((RR_—s cCs ||ijS(N(RsRRr(RRs((Rt __contains__šscCs |iiƒS(N(RRrRš(R((RRšœscCs |i|S(N(RRrtother(RRË((Rt__add__žscCs t|iƒS(N(titerRRr(R((Rt__iter__ scCs t|iƒS(N(RRRRr(R((Rt__len__¢scCs tƒ‚dS(N(R(R((RR¤scCst|ddƒS(NRQ(R.RR(R((RR¦s( RR8R9RR_RÊRšRÌRÎRÏRR(((RR “s        cBs)tZdd„Zed„Zd„ZRS(NcCs#tt|ƒi|ƒ||_dS(N(R^RRR_R+tsqltext(RRÐR+((RR_ªscCs|i|ƒdS(N(R}tvisit_check_constraintR(RR}Rz((RR|­scCs||_|ii|ƒdS(N(RRRdRl(RR((RR¯s (RR8RR_R~R|R(((RR©s  cBsStZdZeeeed„Zd„Zed„Zd„Z d„Z d„Z RS(sRtable-level foreign key constraint, represents a colleciton of ForeignKey objects.cCs€tt|ƒi|ƒ||_||_t i ƒ|_ ||_ ||_ |idjo|otidƒ‚n||_dS(Ns9Alterable ForeignKey/ForeignKeyConstraint requires a name(R^RRR_R+Rrt_ForeignKeyConstraint__colnamest refcolumnst"_ForeignKeyConstraint__refcolnamesRaR˜telementsR•tondeleteRR®R#RS(RRrRÓR+R•RÖR®((RR_µs    cCsS||_|ii|ƒx3t|i|iƒD]\}}|i ||ƒq/WdS(N( RQRRdRltzipRÒRÔR{trtappend_element(RRQRØR{((RR¿s   cCs|i|ƒdS(N(R}tvisit_foreign_key_constraintR(RR}Rz((RR|ÄscCs:t|d|ƒ}|i|ii|ƒ|i|ƒdS(NRx( RtrefcolRRœRRQR{tcolR½(RRÜRÛRœ((RRÙÆscCs4|ii|ii|iiƒ|ii|ƒdS(N( RRrRlRQR{RœRRORÕ(RRœ((RR½Ês c Csptg}|iD]}||iiq~g}|iD]}||iƒq8~d|id|id|i ƒS(NR+R•RÖ( RRqRRÕRsRR+R¯R•RÖ(RRqRs((RRÍs( RR8R9RRNR_RR~R|RÙR½R(((RR³s     cBsJtZd„Zd„Zed„Zd„Zd„Zd„Zd„Z RS(NcOs8tt|ƒid|iddƒƒt|ƒ|_ dS(NR+( R^RRR_R)R*RRIRrt_PrimaryKeyConstraint__colnames(RRrR)((RR_Ñs%cCs>||_||_x%|iD]}|i|i|ƒqWdS(N(RQRReRÝR{Rw(RRQR{((RRÔs    cCs|i|ƒdS(N(R}tvisit_primary_key_constraintR(RR}Rz((RR|ÙscCs|i|ƒdS(N(RRwRÜ(RRÜ((RRlÛscCs|ii|ƒt|_dS(N(RRrRlRÜR~Re(RRÜ((RRwÝscCs1td|ig}|D]}||iq~ŒS(NR+(RRR+RqR{RO(RRqR{((RRàscCs |i|jS(N(RRrRË(RRË((Rt__eq__âs( RR8R_RR~R|RlRwRRß(((RRÐs      cBs/tZd„Zd„Zd„Zed„ZRS(NcOs8tt|ƒid|iddƒƒt|ƒ|_ dS(NR+( R^R RR_R)R*RRIRrt_UniqueConstraint__colnames(RRrR)((RR_æs%cCsE||_|ii|ƒx%|iD]}|i|i|ƒq#WdS(N(RQRRdRlRàR{Rw(RRQR{((RRés   cCs|ii|ƒdS(N(RRrRlRÜ(RRÜ((RRwîscCs|i|ƒdS(N(R}tvisit_unique_constraintR(RR}Rz((RR|ðs(RR8R_RRwR~R|(((RR ås   cBsztZdZd„Zd„Zd„Zd„Zd„Zd„Ze d„Z e d„Z e d „Z d „Zd „ZRS( s9Represents an index of columns from a database table cOsA||_g|_d|_|idtƒ|_|i |ŒdS(sBConstructs an index object. Arguments are: name : the name of the index *columns : columns to include in the index. All columns must belong to the same table, and no column may appear more than once. **kw : keyword arguments include: unique=True : create a unique index R”N( R+RRrRRQR)R*RNR”R(RR+RrR)((RR_ös    cCs |iiS(N(RRQR;(R((RRscGs"x|D]}|i|ƒqWdS(N(RRvRRw(RRRv((RR scCs|iS(N(RRQ(R((RR scCs||_|ii|ƒdS(N(RQRRcRl(RRQ((RRs cCsÂ|idjo|i|iƒn‹|i|ijo&tid||i|ifƒ‚nR|ig}|i D]}||iqq~jo tid|i|fƒ‚n|i i |ƒdS(Ns?All index columns must be from same table. %s is from %s not %ssJA column may not appear twice in the same index (%s already has column %s)( RRQRRRvR#RSR+RqRrR{RŒ(RRvR{Rq((RRws&1 cCs5|dj o|i|ƒn|iƒi|ƒ|S(N(R„RR‰RR%(RR„((RR‰$s cCs5|dj o|i|ƒn|iƒi|ƒdS(N(R„RR‹RR%(RR„((RR‹*s cCs|i|ƒdS(N(R}t visit_indexR(RR}Rz((RR|/scCs t|ƒS(N(RpR(R((RRu1scCsRd|idig}|iD]}|t|ƒq~ƒ|iodpdfS(NsIndex("%s", %s%s)s, s , unique=TrueR\(RR+RoRqRrR{RpR”(RRqR{((RR3s(RR8R9R_RRRRRwRR‰R‹R~R|RuR(((RRós           cBs†tZdZed„Zd„Zd„Zeed„Zd„Z eeed„Z eeed„Z ed„Z d „Z d „ZRS( sIrepresents a collection of Tables and their associated schema constructs.cKs&h|_||_|i||ƒdS(N(RRPR+R,R)(RR+R)((RR_;s  cCstS(N(RN(R((Rtis_bound?scCs|iiƒdS(N(RRPtclear(R((RRäAscCsxdk}|djo|iiƒ}n"ti|ƒi|iiƒƒ}|i i t |ƒƒ}t |id|ƒƒS(Ntreverse(tsqlalchemy.sql_utilt sqlalchemyRPRRtvaluesRaRbt intersectiontsql_utiltTableCollectionRItsorterRÍtsortRå(RRåRPRçRì((Rttable_iteratorDs   !cCsdS(N(R(R((RRLscCs:|djo|iƒ}n|i|d|d|ƒdS(s¢create all tables stored in this metadata. This will conditionally create tables depending on if they do not yet exist in the database. connectable - a Connectable used to access the database; or use the engine bound to this MetaData. tables - optional list of tables, which is a subset of the total tables in the MetaData (others are ignored)R‡RPN(R„RRR%R‰R‡RP(RR„RPR‡((RRˆNs  cCs:|djo|iƒ}n|i|d|d|ƒdS(s§drop all tables stored in this metadata. This will conditionally drop tables depending on if they currently exist in the database. connectable - a Connectable used to access the database; or use the engine bound to this MetaData. tables - optional list of tables, which is a subset of the total tables in the MetaData (others are ignored) R‡RPN(R„RRR%R‹R‡RP(RR„RPR‡((RRŠ]s  cCs|i|ƒdS(N(R}tvisit_metadataR(RR}Rz((RR|nscCs|S(N(R(R((RRqscCs|iƒpdSn|iS(N(RRãRt_engine(R((RR!ss (RR8R9RR_RãRäR~RîRRˆRŠR|RR!(((RR 9s       cBs#tZdZed„Zd„ZRS(sSbuilds upon MetaData to provide the capability to bind to an Engine implementation.cKsOtt|ƒi||t|tƒot i |||_ n ||_ dS(N( R^R RR_R+R)REt engine_or_urlRLRçt create_engineRð(RRñR+R)((RR_zscCstS(N(R~(R((RRã€s(RR8R9RR_Rã(((RR xs  cBsMtZdZeed„Zd„Zd„Zd„Zd„Z e e ƒZ RS(sbuilds upon MetaData to provide the capability to bind to multiple Engine implementations on a dynamically alterable, thread-local basis.cKsItt|ƒi|||otiƒ|_ n ||_ h|_ dS(N( R^RRR_R+R)t threadlocalRat ThreadLocaltcontextt_DynamicMetaData__engines(RR+RóR)((RR_†s  cKs t|tƒo\y|i||i_Wqœtj o2ti ||}||i|<||i_qœXn1|ii |ƒp||i|RUR?t TableClauseRt _ColumnClauseRRR RRRR RRRR RR R Rt ClauseVisitorRRK(RRR RRRûRR³R RRçR RnR RRaRFRRR¹RKR R>RRR#RRR?R((Rt?s2 <D 6•´e  F? #&