PK���ȼRY��������€��� �v3.phpUT �øŽg‰gñ“gux �õ��õ��½T]kÛ0}߯pEhìâÙM7X‰çv%”v0֐µ{)Aå:6S$!ÉMJèߕ?R÷!>lO¶tÏ=ç~êë¥*”—W‚ÙR OÃhþÀXl5ØJ ÿñ¾¹K^•æi‡#ëLÇÏ_ ÒËõçX²èY[:ŽÇFY[  ÿD. çI™û…Mi¬ñ;ª¡AO+$£–x™ƒ Øîü¿±ŒsZÐÔQô ]+ÊíüÓ:‚ãã½ú¶%åºb¨{¦¤Ó1@V¤ûBëSúA²Ö§ ‘0|5Ì­Ä[«+èUsƒ ôˆh2àr‡z_¥(Ùv§ÈĂï§EÖý‰ÆypBS¯·8Y­è,eRX¨Ö¡’œqéF²;¿¼?Ø?Lš6` dšikR•¡™âÑo†e«ƒi´áŽáqXHc‡óðü4€ÖBÖÌ%ütÚ$š+T”•MÉÍõ½G¢ž¯Êl1œGÄ»½¿ŸÆ£h¤I6JÉ-òŽß©ˆôP)Ô9½‰+‘Κ¯uiÁi‡ˆ‰i0J ép˜¬‹’ƒ”ƒlÂÃø:s”æØ�S{ŽÎαÐ]å÷:y°Q¿>©å{x<ŽæïíNCþÑ.Mf?¨«2ý}=ûõýî'=£§ÿu•Ü(—¾IIa­"éþ@¶�¿ä9?^-qìÇÞôvŠeÈc ðlacã®xèÄ'®âd¶ çˆSEæódP/ÍÆv{Ô)Ó ?>…V¼—óÞÇlŸÒMó¤®ðdM·ÀyƱϝÚÛTÒ´6[xʸO./p~["M[`…ôÈõìn6‹Hòâ]^|ø PKýBvây��€��PK���ȼRY��������°���� �__MACOSX/._v3.phpUT �øŽg‰gþ“gux �õ��õ��c`cg`b`ðMLVðVˆP€'qƒøˆŽ!!AP&HÇ %PDF-1.7 1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >> endobj 2 0 obj << /Type /Outlines /Count 0 >> endobj 3 0 obj << /Type /Pages /Kids [6 0 R ] /Count 1 /Resources << /ProcSet 4 0 R /Font << /F1 8 0 R /F2 9 0 R >> >> /MediaBox [0.000 0.000 595.280 841.890] >> endobj 4 0 obj [/PDF /Text ] endobj 5 0 obj << /Producer (���d�o�m�p�d�f� �2�.�0�.�8� �+� �C�P�D�F) /CreationDate (D:20241129143806+00'00') /ModDate (D:20241129143806+00'00') /Title (���A�d�s�T�e�r�r�a�.�c�o�m� �i�n�v�o�i�c�e) >> endobj 6 0 obj << /Type /Page /MediaBox [0.000 0.000 595.280 841.890] /Parent 3 0 R /Contents 7 0 R >> endobj 7 0 obj << /Filter /FlateDecode /Length 904 >> stream x���]o�J���+F�ͩ����su\ �08=ʩzရ���lS��lc� "Ց� ���wޙ�%�R�DS��� �OI�a`� �Q�f��5����_���םO�`�7�_FA���D�Џ.j�a=�j����>��n���R+�P��l�rH�{0��w��0��=W�2D ����G���I�>�_B3ed�H�yJ�G>/��ywy�fk��%�$�2.��d_�h����&)b0��"[\B��*_.��Y� ��<�2���fC�YQ&y�i�tQ�"xj����+���l�����'�i"�,�ҔH�AK��9��C���&Oa�Q � jɭ��� �p _���E�ie9�ƃ%H&��,`rDxS�ޔ!�(�X!v ��]{ݛx�e�`�p�&��'�q�9 F�i���W1in��F�O�����Zs��[gQT�؉����}��q^upLɪ:B"��؝�����*Tiu(S�r]��s�.��s9n�N!K!L�M�?�*[��N�8��c��ۯ�b�� ��� �YZ���SR3�n�����lPN��P�;��^�]�!'�z-���ӊ���/��껣��4�l(M�E�QL��X ��~���G��M|�����*��~�;/=N4�-|y�`�i�\�e�T�<���L��G}�"В�J^���q��"X�?(V�ߣXۆ{��H[����P�� �c���kc�Z�9v�����? �a��R�h|��^�k�D4W���?Iӊ�]<��4�)$wdat���~�����������|�L��x�p|N�*��E� �/4�Qpi�x.>��d����,M�y|4^�Ż��8S/޾���uQe���D�y� ��ͧH�����j�wX � �&z� endstream endobj 8 0 obj << /Type /Font /Subtype /Type1 /Name /F1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >> endobj 9 0 obj << /Type /Font /Subtype /Type1 /Name /F2 /BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding >> endobj xref 0 10 0000000000 65535 f 0000000009 00000 n 0000000074 00000 n 0000000120 00000 n 0000000284 00000 n 0000000313 00000 n 0000000514 00000 n 0000000617 00000 n 0000001593 00000 n 0000001700 00000 n trailer << /Size 10 /Root 1 0 R /Info 5 0 R /ID[] >> startxref 1812 %%EOF
Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 128

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 129

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 130

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 131
 ec@@s;dZddlmZddlZddlZddlmZddlmZddlmZddlm Z dd lm Z dd l m Z dd l m Z dd l mZdd l mZddl mZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddl mZddl mZddlmZddlmZddlmZddlmZej dZ!ej ddZ"ej d d!Z#d"Z$d#Z%ej&d$ee j'fd%YZ(d&ee(efd'YZ)d(ee(efd)YZ*d*ee(fd+YZ+d,ee(fd-YZ,d.e,fd/YZ-d0e.fd1YZ/d2e/e,fd3YZ0ej&d4efd5YZ1d6e1fd7YZ2d8ee(fd9YZ3d:e.fd;YZ4d<e4e3fd=YZ5d>e5fd?YZ6d@e5fdAYZ7dBe5fdCYZ8dDe5fdEYZ9dFee4e(fdGYZ:ej;idHdI6Z<dJe(fdKYZ=ej>dLdMdNdOdPe=fdQYZ?dRe1e(fdSYZ@dTe/e1e(fdUYZAdS(Vs/The schema module provides the building blocks for database metadata. Each element within this module describes a database entity which can be created and dropped, or is otherwise part of such an entity. Examples include tables, columns, sequences, and indexes. All entities are subclasses of :class:`~sqlalchemy.schema.SchemaItem`, and as defined in this module they are intended to be agnostic of any vendor-specific constructs. A collection of entities are grouped into a unit called :class:`~sqlalchemy.schema.MetaData`. MetaData serves as a logical grouping of schema elements, and can also be associated with an actual database connection such that operations involving the contained elements can contact the database as needed. Two of the elements here also build upon their "syntactic" counterparts, which are defined in :class:`~sqlalchemy.sql.expression.`, specifically :class:`~sqlalchemy.schema.Table` and :class:`~sqlalchemy.schema.Column`. Since these objects are part of the SQL expression language, they are usable as components in SQL expressions. i(tabsolute_importNi(t coercions(tddl(troles(ttype_api(tvisitors(t_bind_or_error(tDedupeColumnCollection(t DialectKWArgs(t Executable(tSchemaEventTarget(t_document_text_coercion(t ClauseElement(t ColumnClause(t ColumnElement(t quoted_name(t TextClause(t TableClause(t to_instance(tInternalTraversali(tevent(texc(t inspection(tutils'retain_schemaSymbol indicating that a :class:`_schema.Table`, :class:`.Sequence` or in some cases a :class:`_schema.ForeignKey` object, in situations where the object is being copied for a :meth:`.Table.to_metadata` operation, should retain the schema name that it already has. t blank_schemasSymbol indicating that a :class:`_schema.Table`, :class:`.Sequence` or in some cases a :class:`_schema.ForeignKey` object should have 'None' for its schema, even if the parent :class:`_schema.MetaData` has specified a schema. .. versionadded:: 1.0.14 tNULL_UNSPECIFIEDsSymbol indicating the "nullable" keyword was not passed to a Column. Normally we would expect None to be acceptable for this but some backends such as that of SQL Server place special signficance on a "nullability" value of None. cC@s |dkr|S|d|SdS(Nt.(tNone(tnametschema((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt_get_table_key_s c@sAdksdkr|Sfd}tj|i|S(Nc@sFt|tr>|jkr>|jjkr>j|jSdSdS(N(t isinstancetColumnttabletkeytcR(tcol(t source_tablet target_table(sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pytreplacels (RRtreplacement_traverse(t expressionR%R&R'((R%R&sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt_copy_expressionhs t SchemaItemcB@sMeZdZdZdZdZdZejdZ dZ e Z RS(s3Base class for items that define a database schema.t schema_itemtdefaultcO@stxm|D]e}|dk ry |j}Wn3tk r[}tjtjd|d|qlX|||qqWdS(s7Initialize the list of child items for this SchemaItem.sJ'SchemaItem' object, such as a 'Column' or a 'Constraint' expected, got %rtreplace_contextN(Rt_set_parent_with_dispatchtAttributeErrorRtraise_Rt ArgumentError(tselftargstkwtitemtspwdterr((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt _init_itemss     cC@stj|ddgS(Nt omit_kwargtinfo(Rt generic_repr(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt__repr__scC@siS(sZInfo dictionary associated with the object, allowing user-defined data to be associated with this :class:`.SchemaItem`. The dictionary is automatically generated when first accessed. It can also be specified in the constructor of some objects, such as :class:`_schema.Table` and :class:`_schema.Column`. ((R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR;s cC@s;d|jkr$|jj|_n|jj|j|S(NR;(t__dict__R;tcopytdispatcht_update(R3R,((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt_schema_item_copys( t__name__t __module__t__doc__t__visit_name__tcreate_drop_stringify_dialectR9R=Rtmemoized_propertyR;RBtTruet_use_schema_map(((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR+ys   tTablecB@seZdZdZeZeZejde j fgZe Z dZ ejdddfddd fd Zd Zd Zfe ed ZedZedZdZdZdZdZedZedZdZdZedZdZ e!dZ"dZ#dZ$ej%ddedZ&ee!dZ'ee!d Z(ej%dd!e)eed"Z*e)eed#Z+RS($se8Represent a table in a database. e.g.:: mytable = Table( "mytable", metadata, Column('mytable_id', Integer, primary_key=True), Column('value', String(50)) ) The :class:`_schema.Table` object constructs a unique instance of itself based on its name and optional schema name within the given :class:`_schema.MetaData` object. Calling the :class:`_schema.Table` constructor with the same name and same :class:`_schema.MetaData` argument a second time will return the *same* :class:`_schema.Table` object - in this way the :class:`_schema.Table` constructor acts as a registry function. .. seealso:: :ref:`metadata_describing` - Introduction to database metadata Constructor arguments are as follows: :param name: The name of this table as represented in the database. The table name, along with the value of the ``schema`` parameter, forms a key which uniquely identifies this :class:`_schema.Table` within the owning :class:`_schema.MetaData` collection. Additional calls to :class:`_schema.Table` with the same name, metadata, and schema name will return the same :class:`_schema.Table` object. Names which contain no upper case characters will be treated as case insensitive names, and will not be quoted unless they are a reserved word or contain special characters. A name with any number of upper case characters is considered to be case sensitive, and will be sent as quoted. To enable unconditional quoting for the table name, specify the flag ``quote=True`` to the constructor, or use the :class:`.quoted_name` construct to specify the name. :param metadata: a :class:`_schema.MetaData` object which will contain this table. The metadata is used as a point of association of this table with other tables which are referenced via foreign key. It also may be used to associate this table with a particular :class:`.Connectable`. :param \*args: Additional positional arguments are used primarily to add the list of :class:`_schema.Column` objects contained within this table. Similar to the style of a CREATE TABLE statement, other :class:`.SchemaItem` constructs may be added here, including :class:`.PrimaryKeyConstraint`, and :class:`_schema.ForeignKeyConstraint`. :param autoload: Defaults to ``False``, unless :paramref:`_schema.Table.autoload_with` is set in which case it defaults to ``True``; :class:`_schema.Column` objects for this table should be reflected from the database, possibly augmenting objects that were explicitly specified. :class:`_schema.Column` and other objects explicitly set on the table will replace corresponding reflected objects. .. deprecated:: 1.4 The autoload parameter is deprecated and will be removed in version 2.0. Please use the :paramref:`_schema.Table.autoload_with` parameter, passing an engine or connection. .. seealso:: :ref:`metadata_reflection_toplevel` :param autoload_replace: Defaults to ``True``; when using :paramref:`_schema.Table.autoload` in conjunction with :paramref:`_schema.Table.extend_existing`, indicates that :class:`_schema.Column` objects present in the already-existing :class:`_schema.Table` object should be replaced with columns of the same name retrieved from the autoload process. When ``False``, columns already present under existing names will be omitted from the reflection process. Note that this setting does not impact :class:`_schema.Column` objects specified programmatically within the call to :class:`_schema.Table` that also is autoloading; those :class:`_schema.Column` objects will always replace existing columns of the same name when :paramref:`_schema.Table.extend_existing` is ``True``. .. seealso:: :paramref:`_schema.Table.autoload` :paramref:`_schema.Table.extend_existing` :param autoload_with: An :class:`_engine.Engine` or :class:`_engine.Connection` object, or a :class:`_reflection.Inspector` object as returned by :func:`_sa.inspect` against one, with which this :class:`_schema.Table` object will be reflected. When set to a non-None value, the autoload process will take place for this table against the given engine or connection. :param extend_existing: When ``True``, indicates that if this :class:`_schema.Table` is already present in the given :class:`_schema.MetaData`, apply further arguments within the constructor to the existing :class:`_schema.Table`. If :paramref:`_schema.Table.extend_existing` or :paramref:`_schema.Table.keep_existing` are not set, and the given name of the new :class:`_schema.Table` refers to a :class:`_schema.Table` that is already present in the target :class:`_schema.MetaData` collection, and this :class:`_schema.Table` specifies additional columns or other constructs or flags that modify the table's state, an error is raised. The purpose of these two mutually-exclusive flags is to specify what action should be taken when a :class:`_schema.Table` is specified that matches an existing :class:`_schema.Table`, yet specifies additional constructs. :paramref:`_schema.Table.extend_existing` will also work in conjunction with :paramref:`_schema.Table.autoload` to run a new reflection operation against the database, even if a :class:`_schema.Table` of the same name is already present in the target :class:`_schema.MetaData`; newly reflected :class:`_schema.Column` objects and other options will be added into the state of the :class:`_schema.Table`, potentially overwriting existing columns and options of the same name. As is always the case with :paramref:`_schema.Table.autoload`, :class:`_schema.Column` objects can be specified in the same :class:`_schema.Table` constructor, which will take precedence. Below, the existing table ``mytable`` will be augmented with :class:`_schema.Column` objects both reflected from the database, as well as the given :class:`_schema.Column` named "y":: Table("mytable", metadata, Column('y', Integer), extend_existing=True, autoload_with=engine ) .. seealso:: :paramref:`_schema.Table.autoload` :paramref:`_schema.Table.autoload_replace` :paramref:`_schema.Table.keep_existing` :param implicit_returning: True by default - indicates that RETURNING can be used by default to fetch newly inserted primary key values, for backends which support this. Note that :func:`_sa.create_engine` also provides an ``implicit_returning`` flag. :param include_columns: A list of strings indicating a subset of columns to be loaded via the ``autoload`` operation; table columns who aren't present in this list will not be represented on the resulting ``Table`` object. Defaults to ``None`` which indicates all columns should be reflected. :param resolve_fks: Whether or not to reflect :class:`_schema.Table` objects related to this one via :class:`_schema.ForeignKey` objects, when :paramref:`_schema.Table.autoload` or :paramref:`_schema.Table.autoload_with` is specified. Defaults to True. Set to False to disable reflection of related tables as :class:`_schema.ForeignKey` objects are encountered; may be used either to save on SQL calls or to avoid issues with related tables that can't be accessed. Note that if a related table is already present in the :class:`_schema.MetaData` collection, or becomes present later, a :class:`_schema.ForeignKey` object associated with this :class:`_schema.Table` will resolve to that table normally. .. versionadded:: 1.3 .. seealso:: :paramref:`.MetaData.reflect.resolve_fks` :param info: Optional data dictionary which will be populated into the :attr:`.SchemaItem.info` attribute of this object. :param keep_existing: When ``True``, indicates that if this Table is already present in the given :class:`_schema.MetaData`, ignore further arguments within the constructor to the existing :class:`_schema.Table`, and return the :class:`_schema.Table` object as originally created. This is to allow a function that wishes to define a new :class:`_schema.Table` on first call, but on subsequent calls will return the same :class:`_schema.Table`, without any of the declarations (particularly constraints) being applied a second time. If :paramref:`_schema.Table.extend_existing` or :paramref:`_schema.Table.keep_existing` are not set, and the given name of the new :class:`_schema.Table` refers to a :class:`_schema.Table` that is already present in the target :class:`_schema.MetaData` collection, and this :class:`_schema.Table` specifies additional columns or other constructs or flags that modify the table's state, an error is raised. The purpose of these two mutually-exclusive flags is to specify what action should be taken when a :class:`_schema.Table` is specified that matches an existing :class:`_schema.Table`, yet specifies additional constructs. .. seealso:: :paramref:`_schema.Table.extend_existing` :param listeners: A list of tuples of the form ``(, )`` which will be passed to :func:`.event.listen` upon construction. This alternate hook to :func:`.event.listen` allows the establishment of a listener function specific to this :class:`_schema.Table` before the "autoload" process begins. Historically this has been intended for use with the :meth:`.DDLEvents.column_reflect` event, however note that this event hook may now be associated with the :class:`_schema.MetaData` object directly:: def listen_for_reflect(table, column_info): "handle the column reflection event" # ... t = Table( 'sometable', autoload_with=engine, listeners=[ ('column_reflect', listen_for_reflect) ]) .. seealso:: :meth:`_events.DDLEvents.column_reflect` :param must_exist: When ``True``, indicates that this Table must already be present in the given :class:`_schema.MetaData` collection, else an exception is raised. :param prefixes: A list of strings to insert after CREATE in the CREATE TABLE statement. They will be separated by spaces. :param quote: Force quoting of this table's name on or off, corresponding to ``True`` or ``False``. When left at its default of ``None``, the column identifier will be quoted according to whether the name is case sensitive (identifiers with at least one upper case character are treated as case sensitive), or if it's a reserved word. This flag is only needed to force quoting of a reserved word which is not known by the SQLAlchemy dialect. .. note:: setting this flag to ``False`` will not provide case-insensitive behavior for table reflection; table reflection will always search for a mixed-case name in a case sensitive fashion. Case insensitive names are specified in SQLAlchemy only by stating the name with all lower case characters. :param quote_schema: same as 'quote' but applies to the schema identifier. :param schema: 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. Defaults to ``None``. If the owning :class:`_schema.MetaData` of this :class:`_schema.Table` specifies its own :paramref:`_schema.MetaData.schema` parameter, then that schema name will be applied to this :class:`_schema.Table` if the schema parameter here is set to ``None``. To set a blank schema name on a :class:`_schema.Table` that would otherwise use the schema set on the owning :class:`_schema.MetaData`, specify the special symbol :attr:`.BLANK_SCHEMA`. .. versionadded:: 1.0.14 Added the :attr:`.BLANK_SCHEMA` symbol to allow a :class:`_schema.Table` to have a blank schema name even when the parent :class:`_schema.MetaData` specifies :paramref:`_schema.MetaData.schema`. The quoting rules for the schema name are the same as those for the ``name`` parameter, in that quoting is applied for reserved words or case-sensitive names; to enable unconditional quoting for the schema name, specify the flag ``quote_schema=True`` to the constructor, or use the :class:`.quoted_name` construct to specify the name. :param comment: Optional string that will render an SQL comment on table creation. .. versionadded:: 1.2 Added the :paramref:`_schema.Table.comment` parameter to :class:`_schema.Table`. :param \**kw: Additional keyword arguments not mentioned above are dialect specific, and passed in the form ``_``. See the documentation regarding an individual dialect at :ref:`dialect_toplevel` for detail on documented arguments. R!RcC@s"|jr|f|jS|fSdS(N(t _annotationst_annotations_cache_key(R3tanon_mapt bindparams((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt_gen_cache_key%s t mustexists1.4s8Deprecated alias of :paramref:`_schema.Table.must_exist`tautoloads2.0sThe autoload parameter is deprecated and will be removed in version 2.0. Please use the autoload_with parameter, passing an engine or connection.c O@s9| r| rtj|Sy$|d|d|d}}}Wntk r^tdnX|jdd}|dkr|j}n|tkrd}n|jdt}|jdt}|r|rd}t j |n|j d |j d t} t ||} | |j kr|| rR| rRt|rRt jd | n|j | } |rx| j||n| S| rt jd | ntj|} | jj| ||j||| y1| j||||| jj| || SWn4tk r4tj|j||WdQXnXdS( NiiisJTable() takes at least two positional-only arguments 'name' and 'metadata'Rt keep_existingtextend_existings9keep_existing and extend_existing are mutually exclusive.t must_existRQsTable '%s' is already defined for this MetaData instance. Specify 'extend_existing=True' to redefine options and columns on an existing Table object.sTable '%s' not defined(tobjectt__new__t IndexErrort TypeErrortgetRRt BLANK_SCHEMAtFalseRR2tpopRttablestbooltInvalidRequestErrort_init_existingR@tbefore_parent_attacht _add_tablet_inittafter_parent_attacht ExceptionRt safe_reraiset _remove_table( tclsR4R5RtmetadataRRSRTtmsgRUR"R!((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRW+sP  $           cO@sdS(sConstructor for :class:`_schema.Table`. This method is a no-op. See the top-level documentation for :class:`_schema.Table` for constructor arguments. N((R3R4R5((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt__init__mtcO@stt|jt||jdd||_|jdd|_|jdkrg|j|_nB|jtkrd|_n'|jdd}t|j||_t |_ t |_ t dt j|t |_t |_|jdk rd|j|jf|_n |j|_|jdd}|jd|dk }|jdt |jd t}|jd t} |jd d} |jd t } |jd d} |jdt |_|jdd|_d|kr|jd|_nd|krM|jd} x*| D]\}}tj|||q'Wn|jddpbg|_|j||r|j||| d | d | n|jd| p|p||dS(NtquoteRt quote_schemat_implicit_generateds%s.%st autoload_withRRtautoload_replaceRSRTt _extend_ont resolve_fkstinclude_columnstimplicit_returningtcommentR;t listenerstprefixestallow_replacements(tsuperRKRlRR]RRjRR[tsettindexest constraintstPrimaryKeyConstraintRIR/t foreign_keyst_extra_dependenciesRtfullnameR\RvRwR;Rtlistent _prefixest _extra_kwargst _autoloadR9(R3RRjR4tkwargsRoRqRRRSRTRsRtRuRxtevttfn((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRdxs^             c C@se|dkr!t|dd}ntj|}|j#}|j||||d|WdQXdS(NRksuNo engine is bound to this Table's MetaData. Pass an engine to the Table via autoload_with=Rs(RRRtinspectt_inspection_contextt reflect_table( R3RjRqRutexclude_columnsRtRstinspt conn_insp((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRs  cC@st|jddS(sTReturn the set of constraints as a list, sorted by creation order. R"cS@s|jS(N(t_creation_order(R#((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pytRm(tsortedR~(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt_sorted_constraintsscC@std|jDS(s:class:`_schema.ForeignKeyConstraint` objects referred to by this :class:`_schema.Table`. This list is produced from the collection of :class:`_schema.ForeignKey` objects currently associated. .. seealso:: :attr:`_schema.Table.constraints` :attr:`_schema.Table.foreign_keys` :attr:`_schema.Table.indexes` cs@s|]}|jVqdS(N(t constraint(t.0tfkc((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pys s(R|R(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pytforeign_key_constraintssc O@s |jdd}|jd|dk }|jdt}|jdd}|jdd}|jdt|jdt|r||jkrtjd|j|fn|jd d}|dk r x6|jD](} | j|kr|j j | qqWn|jd t} x,dD]$} | |kr#tjd q#q#W|jd|j |_ |jd|j |_ |jd|j |_ |r|sg|jD]} | j^q} nd} |j|j||| | d|n|j||j|dS(NRqRRRrRRsRTRSs7Can't change schema of existing table from '%s' to '%s'RuRtRnRos2Can't redefine 'quote' or 'quote_schema' argumentsRwRvR;(RnRo((R]RRIR\RRR2R#Rt_columnstremoveRwRvR;RRjRR9( R3R4RRqRRRrRRsRuR#RtR"R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRasL   "  cK@s|j|dS(N(t_validate_dialect_kwargs(R3R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR2scC@sdS(N((R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt_init_collections5scC@sdS(N((R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt_reset_exported8scC@s |jjS(N(t primary_keyt_autoincrement_column(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR;scC@st|j|jS(sReturn the 'key' for this :class:`_schema.Table`. This value is used as the dictionary key within the :attr:`_schema.MetaData.tables` collection. It is typically the same as that of :attr:`_schema.Table.name` for a table with no :attr:`_schema.Table.schema` set; otherwise it is typically of the form ``schemaname.tablename``. (RRR(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR"?s c C@sddjt|jgt|jgg|jD]}t|^q2gdgD]%}d|tt||f^qRS(Ns Table(%s)s, Rs%s=%s(tjointreprRRjtcolumnstgetattr(R3txtk((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR=Ms cC@st|j|jS(N(Rt descriptionR(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt__str__UscC@s|jr|jjpdS(s2Return the connectable associated with this Table.N(RjtbindR(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRXscC@s|jj|dS(sAdd a 'dependency' for this Table. This is another Table object which must be created first before this one can, or dropped after this one. Usually, dependencies between tables are determined via ForeignKey objects. However, for other situations that create dependencies outside of foreign keys (rules, inheriting), this method can manually establish such a link. N(Rtadd(R3R!((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pytadd_is_dependent_on^s cC@s|j|d|dS(sAppend a :class:`_schema.Column` to this :class:`_schema.Table`. The "key" of the newly added :class:`_schema.Column`, i.e. the value of its ``.key`` attribute, will then be available in the ``.c`` collection of this :class:`_schema.Table`, and the column definition will be included in any CREATE TABLE, SELECT, UPDATE, etc. statements generated from this :class:`_schema.Table` construct. Note that this does **not** change the definition of the table as it exists within any underlying database, assuming that table has already been created in the database. Relational databases support the addition of columns to existing tables using the SQL ALTER command, which would need to be emitted for an already-existing table that doesn't contain the newly added column. :param replace_existing: When ``True``, allows replacing existing columns. When ``False``, the default, an warning will be raised if a column with the same ``.key`` already exists. A future version of sqlalchemy will instead rise a warning. .. versionadded:: 1.4.0 RzN(R/(R3tcolumntreplace_existing((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt append_columnlscC@s|j|dS(sAppend a :class:`_schema.Constraint` to this :class:`_schema.Table`. This has the effect of the constraint being included in any future CREATE TABLE statement, assuming specific DDL creation events have not been associated with the given :class:`_schema.Constraint` object. Note that this does **not** produce the constraint within the relational database automatically, for a table that already exists in the database. To add a constraint to an existing relational database table, the SQL ALTER command must be used. SQLAlchemy also provides the :class:`.AddConstraint` construct which can produce this SQL when invoked as an executable clause. N(R/(R3R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pytappend_constraintscK@s&|j|j|j|||_dS(N(RcRRRj(R3RjR5((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt _set_parentssThe :meth:`_schema.Table.exists` method is deprecated and will be removed in a future release. Please refer to :meth:`_reflection.Inspector.has_table`.cC@sC|dkrt|}ntj|}|j|jd|jS(s!Return True if this table exists.RN(RRRRt has_tableRR(R3RR((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pytexistss cC@s8|dkrt|}n|jtj|d|dS(s-Issue a ``CREATE`` statement for this :class:`_schema.Table`, using the given :class:`.Connectable` for connectivity. .. note:: the "bind" argument will be required in SQLAlchemy 2.0. .. seealso:: :meth:`_schema.MetaData.create_all`. t checkfirstN(RRt_run_ddl_visitorRtSchemaGenerator(R3RR((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pytcreates cC@s8|dkrt|}n|jtj|d|dS(s)Issue a ``DROP`` statement for this :class:`_schema.Table`, using the given :class:`.Connectable` for connectivity. .. note:: the "bind" argument will be required in SQLAlchemy 2.0. .. seealso:: :meth:`_schema.MetaData.drop_all`. RN(RRRRt SchemaDropper(R3RR((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pytdrops sP:meth:`_schema.Table.tometadata` is renamed to :meth:`_schema.Table.to_metadata`cC@s|j|d|d|d|S(sReturn a copy of this :class:`_schema.Table` associated with a different :class:`_schema.MetaData`. See :meth:`_schema.Table.to_metadata` for a full description. Rtreferred_schema_fnR(t to_metadata(R3RjRRR((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt tometadatas c C@s|dkr|j}n|tkr0|j}n|dkrH|j}nt||}||jkrtjd|j|j|Sg}x*|j D]}|j |j d|qWt ||d|d|j ||j}x|jD]}t|trb|j} |r%||||| } n| |jkr:|nd} |j|j d| d|q|js|jrzqn|j|j d|d|qqWxg|jD]\} | jrqnt| jd| jd|g| jD]} t| ||^q| jqW|j|S(s Return a copy of this :class:`_schema.Table` associated with a different :class:`_schema.MetaData`. E.g.:: m1 = MetaData() user = Table('user', m1, Column('id', Integer, primary_key=True)) m2 = MetaData() user_copy = user.to_metadata(m2) .. versionchanged:: 1.4 The :meth:`_schema.Table.to_metadata` function was renamed from :meth:`_schema.Table.tometadata`. :param metadata: Target :class:`_schema.MetaData` object, into which the new :class:`_schema.Table` object will be created. :param schema: optional string name indicating the target schema. Defaults to the special symbol :attr:`.RETAIN_SCHEMA` which indicates that no change to the schema name should be made in the new :class:`_schema.Table`. If set to a string name, the new :class:`_schema.Table` will have this new name as the ``.schema``. If set to ``None``, the schema will be set to that of the schema set on the target :class:`_schema.MetaData`, which is typically ``None`` as well, unless set explicitly:: m2 = MetaData(schema='newschema') # user_copy_one will have "newschema" as the schema name user_copy_one = user.to_metadata(m2, schema=None) m3 = MetaData() # schema defaults to None # user_copy_two will have None as the schema name user_copy_two = user.to_metadata(m3, schema=None) :param referred_schema_fn: optional callable which can be supplied in order to provide for the schema name that should be assigned to the referenced table of a :class:`_schema.ForeignKeyConstraint`. The callable accepts this parent :class:`_schema.Table`, the target schema that we are changing to, the :class:`_schema.ForeignKeyConstraint` object, and the existing "target schema" of that constraint. The function should return the string schema name that should be applied. To reset the schema to "none", return the symbol :data:`.BLANK_SCHEMA`. To effect no change, return ``None`` or :data:`.RETAIN_SCHEMA`. .. versionchanged:: 1.4.33 The ``referred_schema_fn`` function may return the :data:`.BLANK_SCHEMA` or :data:`.RETAIN_SCHEMA` symbols. E.g.:: def referred_schema_fn(table, to_schema, constraint, referred_schema): if referred_schema == 'base_tables': return referred_schema else: return to_schema new_table = table.to_metadata(m2, schema="alt_schema", referred_schema_fn=referred_schema_fn) .. versionadded:: 0.9.2 :param name: optional string name indicating the target table name. If not specified or None, the table name is retained. This allows a :class:`_schema.Table` to be copied to the same :class:`_schema.MetaData` target with a new name. .. versionadded:: 1.0.0 sBTable '%s' already exists within the given MetaData - not copying.RRwR&tuniquet_tableN(RRt RETAIN_SCHEMARRR^RtwarnRRtappendt_copyRKRwRR~RtForeignKeyConstraintt_referred_schemaRt _type_boundt _column_flagR}tIndexRt expressionsR*RB( R3RjRRRR"R4R#R!treferred_schematfk_constraint_schematindextexpr((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRsZV                ((,RCRDRERFRR~R}Rt_traverse_internalsRt dp_stringRIt _is_tableRPRtdeprecated_paramsRWRlRdRtpropertyRRRaRRRRR"R=RRRR\RRRt deprecatedRRRRRR(((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRKsbL    ; N  9          R cB@seZdZdZeZdZeZeZ eZ e j dZ dZdZdZdZdZed Zd Zd Ze jd d dZdZeeedZRS(s(Represents a column in a database table.RcO@s|jdt}|jdt}t|}|rt|dtjr||tk rjtjdn|jd}nn|r|d}t|dr|tk rtjdn|jd}nn|tk rt ||jdt}nd|krtjdnt t |j |||jd ||_ |jd t|_}|jd t|_}|tk r||_n | |_|jd t|_|jd t|_|jdt|_|jdt|_|jdt|_|jdt|_|jdt|_|jdt|_|jdd|_t|_t|_|jdt|_t|_ t|_!d|kr|jd|_"n%t|j#t$r|j#j%|n|jtk r}t|jt&t'fr|j(|jnct)|j#dtrdt|jtj*ratj+d|j |jfnn|j(t&|jn|jtk rt|jt,r|j(|jj-tn|j(t.|jn|jtk r,t|jt&t'fr |j(|jn|j(t&|jdt/n|jtk rt|jt,ri|j(|jj-t/n|j(t.|jdt/n|j0|tj1|d|kr|jd|_2n|j3|dS(sb Construct a new ``Column`` object. :param name: The name of this column as represented in the database. This argument may be the first positional argument, or specified via keyword. Names which contain no upper case characters will be treated as case insensitive names, and will not be quoted unless they are a reserved word. Names with any number of upper case characters will be quoted and sent exactly. Note that this behavior applies even for databases which standardize upper case names as case insensitive such as Oracle. The name field may be omitted at construction time and applied later, at any time before the Column is associated with a :class:`_schema.Table`. This is to support convenient usage within the :mod:`~sqlalchemy.ext.declarative` extension. :param type\_: The column's type, indicated using an instance which subclasses :class:`~sqlalchemy.types.TypeEngine`. If no arguments are required for the type, the class of the type can be sent as well, e.g.:: # use a type with arguments Column('data', String(50)) # use no arguments Column('level', Integer) The ``type`` argument may be the second positional argument or specified by keyword. If the ``type`` is ``None`` or is omitted, it will first default to the special type :class:`.NullType`. If and when this :class:`_schema.Column` is made to refer to another column using :class:`_schema.ForeignKey` and/or :class:`_schema.ForeignKeyConstraint`, the type of the remote-referenced column will be copied to this column as well, at the moment that the foreign key is resolved against that remote :class:`_schema.Column` object. .. versionchanged:: 0.9.0 Support for propagation of type to a :class:`_schema.Column` from its :class:`_schema.ForeignKey` object has been improved and should be more reliable and timely. :param \*args: Additional positional arguments include various :class:`.SchemaItem` derived constructs which will be applied as options to the column. These include instances of :class:`.Constraint`, :class:`_schema.ForeignKey`, :class:`.ColumnDefault`, :class:`.Sequence`, :class:`.Computed` :class:`.Identity`. In some cases an equivalent keyword argument is available such as ``server_default``, ``default`` and ``unique``. :param autoincrement: Set up "auto increment" semantics for an **integer primary key column with no foreign key dependencies** (see later in this docstring for a more specific definition). This may influence the :term:`DDL` that will be emitted for this column during a table create, as well as how the column will be considered when INSERT statements are compiled and executed. The default value is the string ``"auto"``, which indicates that a single-column (i.e. non-composite) primary key that is of an INTEGER type with no other client-side or server-side default constructs indicated should receive auto increment semantics automatically. Other values include ``True`` (force this column to have auto-increment semantics for a :term:`composite primary key` as well), ``False`` (this column should never have auto-increment semantics), and the string ``"ignore_fk"`` (special-case for foreign key columns, see below). The term "auto increment semantics" refers both to the kind of DDL that will be emitted for the column within a CREATE TABLE statement, when methods such as :meth:`.MetaData.create_all` and :meth:`.Table.create` are invoked, as well as how the column will be considered when an INSERT statement is compiled and emitted to the database: * **DDL rendering** (i.e. :meth:`.MetaData.create_all`, :meth:`.Table.create`): When used on a :class:`.Column` that has no other default-generating construct associated with it (such as a :class:`.Sequence` or :class:`.Identity` construct), the parameter will imply that database-specific keywords such as PostgreSQL ``SERIAL``, MySQL ``AUTO_INCREMENT``, or ``IDENTITY`` on SQL Server should also be rendered. Not every database backend has an "implied" default generator available; for example the Oracle backend always needs an explicit construct such as :class:`.Identity` to be included with a :class:`.Column` in order for the DDL rendered to include auto-generating constructs to also be produced in the database. * **INSERT semantics** (i.e. when a :func:`_sql.insert` construct is compiled into a SQL string and is then executed on a database using :meth:`_engine.Connection.execute` or equivalent): A single-row INSERT statement will be known to produce a new integer primary key value automatically for this column, which will be accessible after the statement is invoked via the :attr:`.CursorResult.inserted_primary_key` attribute upon the :class:`_result.Result` object. This also applies towards use of the ORM when ORM-mapped objects are persisted to the database, indicating that a new integer primary key will be available to become part of the :term:`identity key` for that object. This behavior takes place regardless of what DDL constructs are associated with the :class:`_schema.Column` and is independent of the "DDL Rendering" behavior discussed in the previous note above. The parameter may be set to ``True`` to indicate that a column which is part of a composite (i.e. multi-column) primary key should have autoincrement semantics, though note that only one column within a primary key may have this setting. It can also be set to ``True`` to indicate autoincrement semantics on a column that has a client-side or server-side default configured, however note that not all dialects can accommodate all styles of default as an "autoincrement". It can also be set to ``False`` on a single-column primary key that has a datatype of INTEGER in order to disable auto increment semantics for that column. .. versionchanged:: 1.1 The autoincrement flag now defaults to ``"auto"`` which indicates autoincrement semantics by default for single-column integer primary keys only; for composite (multi-column) primary keys, autoincrement is never implicitly enabled; as always, ``autoincrement=True`` will allow for at most one of those columns to be an "autoincrement" column. ``autoincrement=True`` may also be set on a :class:`_schema.Column` that has an explicit client-side or server-side default, subject to limitations of the backend database and dialect. The setting *only* has an effect for columns which are: * Integer derived (i.e. INT, SMALLINT, BIGINT). * Part of the primary key * Not referring to another column via :class:`_schema.ForeignKey`, unless the value is specified as ``'ignore_fk'``:: # turn on autoincrement for this column despite # the ForeignKey() Column('id', ForeignKey('other.id'), primary_key=True, autoincrement='ignore_fk') It is typically not desirable to have "autoincrement" enabled on a column that refers to another via foreign key, as such a column is required to refer to a value that originates from elsewhere. The setting has these effects on columns that meet the above criteria: * DDL issued for the column, if the column does not already include a default generating construct supported by the backend such as :class:`.Identity`, will include database-specific keywords intended to signify this column as an "autoincrement" column for specific backends. Behavior for primary SQLAlchemy dialects includes: * AUTO INCREMENT on MySQL and MariaDB * SERIAL on PostgreSQL * IDENTITY on MS-SQL - this occurs even without the :class:`.Identity` construct as the :paramref:`.Column.autoincrement` parameter pre-dates this construct. * SQLite - SQLite integer primary key columns are implicitly "auto incrementing" and no additional keywords are rendered; to render the special SQLite keyword ``AUTOINCREMENT`` is not included as this is unnecessary and not recommended by the database vendor. See the section :ref:`sqlite_autoincrement` for more background. * Oracle - The Oracle dialect has no default "autoincrement" feature available at this time, instead the :class:`.Identity` construct is recommended to achieve this (the :class:`.Sequence` construct may also be used). * Third-party dialects - consult those dialects' documentation for details on their specific behaviors. * When a single-row :func:`_sql.insert` construct is compiled and executed, which does not set the :meth:`_sql.Insert.inline` modifier, newly generated primary key values for this column will be automatically retrieved upon statement execution using a method specific to the database driver in use: * MySQL, SQLite - calling upon ``cursor.lastrowid()`` (see `https://www.python.org/dev/peps/pep-0249/#lastrowid `_) * PostgreSQL, SQL Server, Oracle - use RETURNING or an equivalent construct when rendering an INSERT statement, and then retrieving the newly generated primary key values after execution * PostgreSQL, Oracle for :class:`_schema.Table` objects that set :paramref:`_schema.Table.implicit_returning` to False - for a :class:`.Sequence` only, the :class:`.Sequence` is invoked explicitly before the INSERT statement takes place so that the newly generated primary key value is available to the client * SQL Server for :class:`_schema.Table` objects that set :paramref:`_schema.Table.implicit_returning` to False - the ``SELECT scope_identity()`` construct is used after the INSERT statement is invoked to retrieve the newly generated primary key value. * Third-party dialects - consult those dialects' documentation for details on their specific behaviors. * For multiple-row :func:`_sql.insert` constructs invoked with a list of parameters (i.e. "executemany" semantics), primary-key retrieving behaviors are generally disabled, however there may be special APIs that may be used to retrieve lists of new primary key values for an "executemany", such as the psycopg2 "fast insertmany" feature. Such features are very new and may not yet be well covered in documentation. :param default: A scalar, Python callable, or :class:`_expression.ColumnElement` expression representing the *default value* for this column, which will be invoked upon insert if this column is otherwise not specified in the VALUES clause of the insert. This is a shortcut to using :class:`.ColumnDefault` as a positional argument; see that class for full detail on the structure of the argument. Contrast this argument to :paramref:`_schema.Column.server_default` which creates a default generator on the database side. .. seealso:: :ref:`metadata_defaults_toplevel` :param doc: optional String that can be used by the ORM or similar to document attributes on the Python side. This attribute does **not** render SQL comments; use the :paramref:`_schema.Column.comment` parameter for this purpose. :param key: An optional string identifier which will identify this ``Column`` object on the :class:`_schema.Table`. When a key is provided, this is the only identifier referencing the ``Column`` within the application, including ORM attribute mapping; the ``name`` field is used only when rendering SQL. :param index: When ``True``, indicates that a :class:`_schema.Index` construct will be automatically generated for this :class:`_schema.Column`, which will result in a "CREATE INDEX" statement being emitted for the :class:`_schema.Table` when the DDL create operation is invoked. Using this flag is equivalent to making use of the :class:`_schema.Index` construct explicitly at the level of the :class:`_schema.Table` construct itself:: Table( "some_table", metadata, Column("x", Integer), Index("ix_some_table_x", "x") ) To add the :paramref:`_schema.Index.unique` flag to the :class:`_schema.Index`, set both the :paramref:`_schema.Column.unique` and :paramref:`_schema.Column.index` flags to True simultaneously, which will have the effect of rendering the "CREATE UNIQUE INDEX" DDL instruction instead of "CREATE INDEX". The name of the index is generated using the :ref:`default naming convention ` which for the :class:`_schema.Index` construct is of the form ``ix__``. As this flag is intended only as a convenience for the common case of adding a single-column, default configured index to a table definition, explicit use of the :class:`_schema.Index` construct should be preferred for most use cases, including composite indexes that encompass more than one column, indexes with SQL expressions or ordering, backend-specific index configuration options, and indexes that use a specific name. .. note:: the :attr:`_schema.Column.index` attribute on :class:`_schema.Column` **does not indicate** if this column is indexed or not, only if this flag was explicitly set here. To view indexes on a column, view the :attr:`_schema.Table.indexes` collection or use :meth:`_reflection.Inspector.get_indexes`. .. seealso:: :ref:`schema_indexes` :ref:`constraint_naming_conventions` :paramref:`_schema.Column.unique` :param info: Optional data dictionary which will be populated into the :attr:`.SchemaItem.info` attribute of this object. :param nullable: When set to ``False``, will cause the "NOT NULL" phrase to be added when generating DDL for the column. When ``True``, will normally generate nothing (in SQL this defaults to "NULL"), except in some very specific backend-specific edge cases where "NULL" may render explicitly. Defaults to ``True`` unless :paramref:`_schema.Column.primary_key` is also ``True`` or the column specifies a :class:`_sql.Identity`, in which case it defaults to ``False``. This parameter is only used when issuing CREATE TABLE statements. .. note:: When the column specifies a :class:`_sql.Identity` this parameter is in general ignored by the DDL compiler. The PostgreSQL database allows nullable identity column by setting this parameter to ``True`` explicitly. :param onupdate: A scalar, Python callable, or :class:`~sqlalchemy.sql.expression.ClauseElement` representing a default value to be applied to the column within UPDATE statements, which will be invoked upon update if this column is not present in the SET clause of the update. This is a shortcut to using :class:`.ColumnDefault` as a positional argument with ``for_update=True``. .. seealso:: :ref:`metadata_defaults` - complete discussion of onupdate :param primary_key: If ``True``, marks this column as a primary key column. Multiple columns can have this flag set to specify composite primary keys. As an alternative, the primary key of a :class:`_schema.Table` can be specified via an explicit :class:`.PrimaryKeyConstraint` object. :param server_default: A :class:`.FetchedValue` instance, str, Unicode or :func:`~sqlalchemy.sql.expression.text` construct representing the DDL DEFAULT value for the column. String types will be emitted as-is, surrounded by single quotes:: Column('x', Text, server_default="val") x TEXT DEFAULT 'val' A :func:`~sqlalchemy.sql.expression.text` expression will be rendered as-is, without quotes:: Column('y', DateTime, server_default=text('NOW()')) y DATETIME DEFAULT NOW() Strings and text() will be converted into a :class:`.DefaultClause` object upon initialization. This parameter can also accept complex combinations of contextually valid SQLAlchemy expressions or constructs:: from sqlalchemy import create_engine from sqlalchemy import Table, Column, MetaData, ARRAY, Text from sqlalchemy.dialects.postgresql import array engine = create_engine( 'postgresql://scott:tiger@localhost/mydatabase' ) metadata_obj = MetaData() tbl = Table( "foo", metadata_obj, Column("bar", ARRAY(Text), server_default=array(["biz", "bang", "bash"]) ) ) metadata_obj.create_all(engine) The above results in a table created with the following SQL:: CREATE TABLE foo ( bar TEXT[] DEFAULT ARRAY['biz', 'bang', 'bash'] ) Use :class:`.FetchedValue` to indicate that an already-existing column will generate a default value on the database side which will be available to SQLAlchemy for post-fetch after inserts. This construct does not specify any DDL and the implementation is left to the database, such as via a trigger. .. seealso:: :ref:`server_defaults` - complete discussion of server side defaults :param server_onupdate: A :class:`.FetchedValue` instance representing a database-side default generation function, such as a trigger. This indicates to SQLAlchemy that a newly generated value will be available after updates. This construct does not actually implement any kind of generation function within the database, which instead must be specified separately. .. warning:: This directive **does not** currently produce MySQL's "ON UPDATE CURRENT_TIMESTAMP()" clause. See :ref:`mysql_timestamp_onupdate` for background on how to produce this clause. .. seealso:: :ref:`triggered_columns` :param quote: Force quoting of this column's name on or off, corresponding to ``True`` or ``False``. When left at its default of ``None``, the column identifier will be quoted according to whether the name is case sensitive (identifiers with at least one upper case character are treated as case sensitive), or if it's a reserved word. This flag is only needed to force quoting of a reserved word which is not known by the SQLAlchemy dialect. :param unique: When ``True``, and the :paramref:`_schema.Column.index` parameter is left at its default value of ``False``, indicates that a :class:`_schema.UniqueConstraint` construct will be automatically generated for this :class:`_schema.Column`, which will result in a "UNIQUE CONSTRAINT" clause referring to this column being included in the ``CREATE TABLE`` statement emitted, when the DDL create operation for the :class:`_schema.Table` object is invoked. When this flag is ``True`` while the :paramref:`_schema.Column.index` parameter is simultaneously set to ``True``, the effect instead is that a :class:`_schema.Index` construct which includes the :paramref:`_schema.Index.unique` parameter set to ``True`` is generated. See the documentation for :paramref:`_schema.Column.index` for additional detail. Using this flag is equivalent to making use of the :class:`_schema.UniqueConstraint` construct explicitly at the level of the :class:`_schema.Table` construct itself:: Table( "some_table", metadata, Column("x", Integer), UniqueConstraint("x") ) The :paramref:`_schema.UniqueConstraint.name` parameter of the unique constraint object is left at its default value of ``None``; in the absence of a :ref:`naming convention ` for the enclosing :class:`_schema.MetaData`, the UNIQUE CONSTRAINT construct will be emitted as unnamed, which typically invokes a database-specific naming convention to take place. As this flag is intended only as a convenience for the common case of adding a single-column, default configured unique constraint to a table definition, explicit use of the :class:`_schema.UniqueConstraint` construct should be preferred for most use cases, including composite constraints that encompass more than one column, backend-specific index configuration options, and constraints that use a specific name. .. note:: the :attr:`_schema.Column.unique` attribute on :class:`_schema.Column` **does not indicate** if this column has a unique constraint or not, only if this flag was explicitly set here. To view indexes and unique constraints that may involve this column, view the :attr:`_schema.Table.indexes` and/or :attr:`_schema.Table.constraints` collections or use :meth:`_reflection.Inspector.get_indexes` and/or :meth:`_reflection.Inspector.get_unique_constraints` .. seealso:: :ref:`schema_unique_constraint` :ref:`constraint_naming_conventions` :paramref:`_schema.Column.index` :param system: When ``True``, indicates this is a "system" column, that is a column which is automatically made available by the database, and should not be included in the columns list for a ``CREATE TABLE`` statement. For more elaborate scenarios where columns should be conditionally rendered differently on different backends, consider custom compilation rules for :class:`.CreateColumn`. :param comment: Optional string that will render an SQL comment on table creation. .. versionadded:: 1.2 Added the :paramref:`_schema.Column.comment` parameter to :class:`_schema.Column`. Rttype_is0May not pass name positionally and as a keyword.t _sqla_types1May not pass type_ positionally and as a keyword.Rns9Explicit 'name' is required when sending 'quote' argumentR"RtnullableR-tserver_defaulttserver_onupdateRRtsystemtdoctonupdatet autoincrementtautoRwt_proxiest_warn_on_bytestrings?Unicode column '%s' has non-unicode default value %r specified.t for_updateR;N(4R]RtlistRRt string_typesRR2thasattrRR{R RlR"R\RRt_user_defined_nullableRR-RRRRRRRRR|R~RRwtcomputedtidentityRttypeR R/t ColumnDefaulttSequenceRRt binary_typeRt FetchedValuet_as_for_updatet DefaultClauseRIR9tset_creation_orderR;R(R3R4RRRtcoltypeRtudn((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRls                    cC@s|jdk o|jjS(sspecial attribute used by cache key gen, if true, we will use a static cache key for the annotations dictionary, else we will generate a new cache key for annotations each time. Added for #8790 N(R!RR(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt!_gen_static_annotations_cache_keys cK@s|j|dS(N(R(R3R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR"scC@sX|jdkrdS|jdk rM|jjrC|jjd|jS|jSn|jSdS(Ns (no name)R(RRR!tnamed_with_columnR(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR%s  cC@s8x1|jD]"}|jjj|jr tSq WtSdS(sOReturn True if this Column references the given column via foreign key.N(RRt proxy_sett intersectionRIR\(R3Rtfk((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt references0scC@s|j|dS(N(R/(R3R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pytappend_foreign_key:sc C@sg}|j|jkr(|jdn|jrA|jdn|jsZ|jdn|jrs|jdn|jr|jdn|jr|jdn|jr|jdndd j t |jgt |j gg|j D]}|dk rt |^qg|jD]}t |^q|jdk rQd |jjpTd gg|D]%}d |t t||f^q_S( NR"RRRR-RRws Column(%s)s, s table=<%s>s table=Nones%s=%s(R"RRRRRR-RRwRRRRRR~R!RR(R3tkwargRR((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR==s"       c@s|jstjdn|j|jdkrC|j|_nt|dd}|dk r|k rtjd|j|jfn|jjkr=jj |j}||k r=|st j d|jjfdnxL|j D]>}j j ||jjkrjj |jqqWq=njj||_|jrrjj|n4|jjkrtjd|jjfn|jrt|jt jrtjdnjtd|jdt|jd tnO|jrVt|jt jr7tjd njt|jd tn|jfd |jrt|j t!st|j"t!rtjd ndS( NsfColumn must be constructed with a non-blank name or assign a non-blank .name before adding to a Table.R!s1Column object '%s' already assigned to Table '%s'sA column with name '%s' is already present in table '%s'. Please use method :meth:`_schema.Table.append_column` with the parameter ``replace_existing=True`` to replace an existing column.s1.4sTTrying to redefine primary-key column '%s' as a non-primary-key column on table '%s'sThe 'index' keyword argument on Column is boolean only. To create indexes with a specific name, create an explicit Index object external to the Table.RRsThe 'unique' keyword argument on Column is boolean only. To create unique constraints or indexes with a specific name, append an explicit UniqueConstraint to the Table's list of elements, or create an explicit Index object external to the Table.c@s |jS(N(t_set_remote_table(R(R!(sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRRms4An column cannot specify both Identity and Sequence.(#RRR2t_reset_memoizationsR"RRRRRZRtwarn_deprecatedRRRR~R'R!Rt_replaceRRRRRRR_RRItUniqueConstraintt_setup_on_memoized_fksRR-RR(R3R!RztexistingR$R((R!sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR\sd          (   cC@s|jj|jftf|jj|jftfg}xf|D]^\}}||jjjkr=x:|jjj|D]"}|j|krr||qrqrWq=q=WdS(N(R!R"R\RRIRjt _fk_memost link_to_name(R3Rtfk_keystfk_keyRR((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRscC@s9|jdk r"|||jntj|d|dS(NRe(R!RRR(R3R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt_on_table_attachss1.4s]The :meth:`_schema.Column.copy` method is deprecated and will be removed in a future release.cK@s |j|S(N(R(R3R5((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR?sc K@sg|jD]}|js |j|^q g|jD]}|js5|j|^q5}i}xP|jD]E}|j|j}x,|jD]\}}|||d| q *  !        (RCRDRERFRIt inherit_cacheRlRRRRRRHRRRRRR=RRRRR?RR\R(((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR s. d      X  ;Rc B@s%eZdZdZdedddddedded ZdZej ddddZ ddZ dddZ e d Zd Ze e Zd Zd Zejd ZdZdZdZejdZedZdZdZdZdZRS(s;Defines a dependency between two columns. ``ForeignKey`` is specified as an argument to a :class:`_schema.Column` object, e.g.:: t = Table("remote_table", metadata, Column("remote_id", ForeignKey("main_table.id")) ) Note that ``ForeignKey`` is only a marker object that defines a dependency between two columns. The actual constraint is in all cases represented by the :class:`_schema.ForeignKeyConstraint` object. This object will be generated automatically when a ``ForeignKey`` is associated with a :class:`_schema.Column` which in turn is associated with a :class:`_schema.Table`. Conversely, when :class:`_schema.ForeignKeyConstraint` is applied to a :class:`_schema.Table`, ``ForeignKey`` markers are automatically generated to be present on each associated :class:`_schema.Column`, which are also associated with the constraint object. Note that you cannot define a "composite" foreign key constraint, that is a constraint between a grouping of multiple parent/child columns, using ``ForeignKey`` objects. To define this grouping, the :class:`_schema.ForeignKeyConstraint` object must be used, and applied to the :class:`_schema.Table`. The associated ``ForeignKey`` objects are created automatically. The ``ForeignKey`` objects associated with an individual :class:`_schema.Column` object are available in the `foreign_keys` collection of that column. Further examples of foreign key configuration are in :ref:`metadata_foreignkeys`. t foreign_keyc K@stjtj||_| |_t|jtjrBd|_ nF|j|_ t|j j tj t fstjd|j j n||_d|_||_||_||_||_||_||_| |_| |_| r| |_n| |_dS(s Construct a column-level FOREIGN KEY. The :class:`_schema.ForeignKey` object when constructed generates a :class:`_schema.ForeignKeyConstraint` which is associated with the parent :class:`_schema.Table` object's collection of constraints. :param column: A single target column for the key relationship. A :class:`_schema.Column` object or a column name as a string: ``tablename.columnkey`` or ``schema.tablename.columnkey``. ``columnkey`` is the ``key`` which has been assigned to the column (defaults to the column name itself), unless ``link_to_name`` is ``True`` in which case the rendered name of the column is used. :param name: Optional string. An in-database name for the key if `constraint` is not provided. :param onupdate: Optional string. If set, emit ON UPDATE when issuing DDL for this constraint. Typical values include CASCADE, DELETE and RESTRICT. :param ondelete: Optional string. If set, emit ON DELETE when issuing DDL for this constraint. Typical values include CASCADE, DELETE and RESTRICT. :param deferrable: Optional bool. If set, emit DEFERRABLE or NOT DEFERRABLE when issuing DDL for this constraint. :param initially: Optional string. If set, emit INITIALLY when issuing DDL for this constraint. :param link_to_name: if True, the string name given in ``column`` is the rendered name of the referenced column, not its locally assigned ``key``. :param use_alter: passed to the underlying :class:`_schema.ForeignKeyConstraint` to indicate the constraint should be generated/dropped externally from the CREATE TABLE/ DROP TABLE statement. See :paramref:`_schema.ForeignKeyConstraint.use_alter` for further description. .. seealso:: :paramref:`_schema.ForeignKeyConstraint.use_alter` :ref:`use_alter` :param match: Optional string. If set, emit MATCH when issuing DDL for this constraint. Typical values include SIMPLE, PARTIAL and FULL. :param info: Optional data dictionary which will be populated into the :attr:`.SchemaItem.info` attribute of this object. .. versionadded:: 1.0.0 :param \**dialect_kw: Additional keyword arguments are dialect specific, and passed in the form ``_``. The arguments are ultimately handled by a corresponding :class:`_schema.ForeignKeyConstraint`. See the documentation regarding an individual dialect at :ref:`dialect_toplevel` for detail on documented arguments. .. versionadded:: 0.9.2 s8ForeignKey received Column not bound to a Table, got: %rN(RRRtDDLReferredColumnRoleRR RRRRt _table_columnR!tNoneTypeRRR2Rtparentt use_alterRRtondeletet deferrablet initiallyRtmatchR;t_unvalidated_dialect_kw(R3RRR#RRR$R%R&RR'R;R t dialect_kw((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRlus.V              cC@sd|jS(NsForeignKey(%r)(t _get_colspec(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR=ss1.4saThe :meth:`_schema.ForeignKey.copy` method is deprecated and will be removed in a future release.cK@s|jd||S(NR(R(R3RR5((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR?scK@sst|jd|d|jd|jd|jd|jd|jd|jd|jd |j |j }|j |S( sProduce a copy of this :class:`_schema.ForeignKey` object. The new :class:`_schema.ForeignKey` will not be bound to any :class:`_schema.Column`. This method is usually used by the internal copy procedures of :class:`_schema.Column`, :class:`_schema.Table`, and :class:`_schema.MetaData`. :param schema: The returned :class:`_schema.ForeignKey` will reference the original table and column name, qualified by the given string schema name. RR#RRR$R%R&RR'( RR*R#RRR$R%R&RR'R(RB(R3RR5R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRs        cC@s|dtfkrg|j\}}}|dk r9|}n|tkrSd||fSd|||fSns|r|j\}}}|rd|||fSd||fSn3|jdk rd|jjj|jjfS|jSdS(sReturn a string based 'column specification' for this :class:`_schema.ForeignKey`. This is usually the equivalent of the string-based "tablename.colname" argument first passed to the object's constructor. s%s.%ss%s.%s.%sN( RRt_column_tokensR[R R!RR"R(R3Rt table_namet_schemattnametcolname((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR* s"    cC@s |jdS(Ni(R+(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR5 scC@sX|jdk r5|jjdkr%dS|jjjSn|j\}}}t||SdS(N(R RR!R"R+R(R3RR.R/((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt _table_key9 s cC@s|j|jdk S(srReturn True if the given :class:`_schema.Table` is referenced by this :class:`_schema.ForeignKey`.N(tcorresponding_columnRR(R3R!((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRE scC@s|j|jS(sReturn the :class:`_schema.Column` in the given :class:`_schema.Table` referenced by this :class:`_schema.ForeignKey`. Returns None if this :class:`_schema.ForeignKey` does not reference the given :class:`_schema.Table`. (R1R(R3R!((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt get_referentL s cC@s|jjd}|dkr:tjd|jnt|dkra|j}d}n|j}|j}t|dkrdj|}nd}|||fS(s7parse a string-based _colspec into its component parts.Rs,Invalid foreign key column specification: %siiN( R*tsplitRRR2RtlenR]R(R3tmR.R/R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR+Y s     cC@s.|jdkr!tjdn$|jjdkrEtjdn|jj}|jr|j\}}}t||}|||fSxH|jjD].}t |t r|j|kst PqqWt st |j\}}}|dkr|j jdk r|j j}nt||}|||fS(NsLthis ForeignKey object does not yet have a parent Column associated with it.sCthis ForeignKey's parent column is not yet associated with a Table.(R"RRR`R!R R+Rt base_columnsRR tAssertionErrorR\RjR(R3t parenttableRR.R/ttablekeyR#((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt_resolve_col_tokensx s*      cC@sd}|dkrN|j}|dk s-t|j}|jj|d}nY|jr|}xG|jD]}|j|krg|}qgqgWn|}|jj|d}|dkrtj d|j |j|j|f|j|n|S(NsiCould not initialize target column for ForeignKey '%s' on table '%s': table '%s' has no column named '%s'( RR"R7R"R#RZRRRtNoReferencedColumnErrorR(R3R8R!R/t_columnR"R"R#((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt_link_to_col_by_colstring s(      c@sb|jdk st|jjjr6j|j_nfd}|jj||_dS(Nc@s%|jjjr!j|j_ndS(N(R"Rt_isnull(R(R(sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pytset_type s(R"RR7RR>RR(R3RR?((RsH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt_set_target_column s cC@s |jS(sReturn the target :class:`_schema.Column` referenced by this :class:`_schema.ForeignKey`. If no target column has been established, an exception is raised. .. versionchanged:: 0.9.0 Foreign key target column resolution now occurs as soon as both the ForeignKey object and the remote Column to which it refers are both associated with the same MetaData object. (R(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR scC@st|jtjr|j\}}}|jsB||jkrq|sLdStj d|j ||f|q|j |jkr|sdStj d|q|jj |}|j|||Sn2t|jdr|jj}|S|j}|SdS(Ns|Foreign key associated with column '%s' could not find table '%s' with which to generate a foreign key to target column '%s's9Table %s is no longer associated with its parent MetaDatat__clause_element__(RRRRR:R RjRRtNoReferencedTableErrorR"R"R`R^R=RRA(R3R R8R9R/R!R<((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR s.   cK@sc|jdk r0|j|k r0tjdn||_|jjj||jj|jdS(Ns&This ForeignKey already has a parent !(R"RRR`RRRt _set_table(R3RR5((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR s   cC@ss|j\}}}|j||||j|||}|j||jdk s_t|jj|dS(N(R:R=R@RRR7t_validate_dest_table(R3R!R8R9R/R<((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR s  cC@sO|j\}}}||f}||j|krK|j|j|ndS(N(R:RR(R3RjR8t table_keyR/R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt_remove_from_metadata s cC@st|tst|jdkrtggd|jd|jd|jd|j d|j d|j d|j |j |_|jj|||jj|n|jj|t|jtjrc|j\}}}||f}||jjkrI|jj|}y|j|||}Wntjk r8qIX|j|n|jj|j|nGt|jdr|jj}|j|n|j}|j|dS( NR#RRR$R%R&R'RA( RRKR7RRRR#RRR$R%R&R'R(t_append_elementR/RRRRRR:RjR^R=RR;R@RRRRA(R3RR!R8RER/RR<((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRC% sB        N(RCRDRERFRR\RlR=RRR?RR*RRR0ttarget_fullnameRR2RHR+R:R=R@RRIRRRRFRC(((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRKsF& l      ( #  $ tDefaultGeneratorcB@steZdZdZeZeZd ZedZ dZ e j dddd dZ dZed ZRS( s'Base class for column *default* values.tdefault_generatorcC@s ||_dS(N(R(R3R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRl[ scK@s1||_|jr!||j_n ||j_dS(N(RRRR-(R3RR5((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR^ s  s!:meth:`.DefaultGenerator.execute`t alternativesAll statement execution in SQLAlchemy 2.0 is performed by the :meth:`_engine.Connection.execute` method of :class:`_engine.Connection`, or in the ORM by the :meth:`.Session.execute` method of :class:`.Session`.cC@s1|dkrt|}n|j|dtjS(N((RRt_execute_defaultRt EMPTY_DICT(R3R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pytexecutee s cC@s|j||||S(N(RL(R3t connectiont multiparamstparamstexecution_options((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt_execute_on_connectionr scC@s-t|dddk r%|jjjSdSdS(s4Return the connectable associated with this default.RN(RRRR!R(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRy s N(RCRDRERFR\t is_sequencetis_server_defaultRRRlRRt deprecated_20RNRSRR(((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRIR s   RcB@seZdZdZejdZejdZejdZejej ddZ dZ dZ RS( sA plain default value on a column. This could correspond to a constant, a callable function, or a SQL clause. :class:`.ColumnDefault` is generated automatically whenever the ``default``, ``onupdate`` arguments of :class:`_schema.Column` are used. A :class:`.ColumnDefault` can be passed positionally as well. For example, the following:: Column('foo', Integer, default=50) Is equivalent to:: Column('foo', Integer, ColumnDefault(50)) cK@sbtt|j|t|tr7tjdnt|rU|j|}n||_ dS(s{Construct a new :class:`.ColumnDefault`. :param arg: argument representing the default value. May be one of the following: * a plain non-callable Python value, such as a string, integer, boolean, or other simple type. The default value will be used as is each time. * a SQL expression, that is one which derives from :class:`_expression.ColumnElement`. The SQL expression will be rendered into the INSERT or UPDATE statement, or in the case of a primary key column when RETURNING is not used may be pre-executed before an INSERT within a SELECT. * A Python callable. The function will be invoked for each new row subject to an INSERT or UPDATE. The callable must accept exactly zero or one positional arguments. The one-argument form will receive an instance of the :class:`.ExecutionContext`, which provides contextual information as to the current :class:`_engine.Connection` in use as well as the current statement and parameters. s4ColumnDefault may not be a server-side default type.N( R{RRlRRRR2tcallablet_maybe_wrap_callabletarg(R3RYR((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRl s  cC@s t|jS(N(RWRY(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt is_callable scC@st|jtS(N(RRYR (R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pytis_clause_element scC@s|j o|j o|j S(N(RZR[RT(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt is_scalar s  ssqlalchemy.sql.sqltypescC@s4tjj}|jr,t|jj|j StSdS(N( Rt preloadedt sql_sqltypesR[RRYRtNullTypeR\(R3tsqltypes((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt _arg_is_typed s  c@sytjdt}Wn'tk rBtjfdSX|ddk rct|dpfd}t|d|}|dkrtjfdS|dkrStjddS( sWrap callables that don't accept a context. This is to allow easy compatibility with default callables that aren't specific to accepting of a context. tno_selfc@sS(N((tctx(R(sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR Rmiic@sS(N((Rc(R(sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR RmisDColumnDefault Python function takes zero or one positional argumentsN( Rtget_callable_argspecRIRYt wrap_callableRR4RR2(R3Rtargspect defaultedt positionals((RsH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRX s &  cC@sd|jfS(NsColumnDefault(%r)(RY(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR= s( RCRDRERlRRHRZR[R\tpreload_moduleRaRXR=(((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR s # tIdentityOptionsc B@s2eZdZdddddddddd ZRS(sDefines options for a named database sequence or an identity column. .. versionadded:: 1.3.18 .. seealso:: :class:`.Sequence` c C@sU||_||_||_||_||_||_||_||_| |_dS(s\Construct a :class:`.IdentityOptions` object. See the :class:`.Sequence` documentation for a complete description of the parameters. :param start: the starting index of the sequence. :param increment: the increment value of the sequence. :param minvalue: the minimum value of the sequence. :param maxvalue: the maximum value of the sequence. :param nominvalue: no minimum value of the sequence. :param nomaxvalue: no maximum value of the sequence. :param cycle: allows the sequence to wrap around when the maxvalue or minvalue has been reached. :param cache: optional integer value; number of future values in the sequence which are calculated in advance. :param order: optional boolean value; if ``True``, renders the ORDER keyword. N( tstartt incrementtminvaluetmaxvaluet nominvaluet nomaxvaluetcycletcachetorder( R3RkRlRmRnRoRpRqRrRs((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRl s        N(RCRDRERRl(((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRj s RcB@seZdZdZeZdddddddddddedddedZe j dZ e j dZ e j ddZdZdZd Zed Zded Zded Zd ZRS(s Represents a named database sequence. The :class:`.Sequence` object represents the name and configurational parameters of a database sequence. It also represents a construct that can be "executed" by a SQLAlchemy :class:`_engine.Engine` or :class:`_engine.Connection`, rendering the appropriate "next value" function for the target database and returning a result. The :class:`.Sequence` is typically associated with a primary key column:: some_table = Table( 'some_table', metadata, Column('id', Integer, Sequence('some_table_seq'), primary_key=True) ) When CREATE TABLE is emitted for the above :class:`_schema.Table`, if the target platform supports sequences, a CREATE SEQUENCE statement will be emitted as well. For platforms that don't support sequences, the :class:`.Sequence` construct is ignored. .. seealso:: :ref:`defaults_sequences` :class:`.CreateSequence` :class:`.DropSequence` tsequencecC@s/tj|d|tj|d|d|d|d|d|d|d|d | d |  t|||_| |_| tkrd |_} nF|d k r| d kr|jr|j|_} nt| ||_||_ t || |_ |r|j |n| d k r"t | |_n d |_d S( s7Construct a :class:`.Sequence` object. :param name: the name of the sequence. :param start: the starting index of the sequence. This value is used when the CREATE SEQUENCE command is emitted to the database as the value of the "START WITH" clause. If ``None``, the clause is omitted, which on most platforms indicates a starting value of 1. :param increment: the increment value of the sequence. This value is used when the CREATE SEQUENCE command is emitted to the database as the value of the "INCREMENT BY" clause. If ``None``, the clause is omitted, which on most platforms indicates an increment of 1. :param minvalue: the minimum value of the sequence. This value is used when the CREATE SEQUENCE command is emitted to the database as the value of the "MINVALUE" clause. If ``None``, the clause is omitted, which on most platforms indicates a minvalue of 1 and -2^63-1 for ascending and descending sequences, respectively. .. versionadded:: 1.0.7 :param maxvalue: the maximum value of the sequence. This value is used when the CREATE SEQUENCE command is emitted to the database as the value of the "MAXVALUE" clause. If ``None``, the clause is omitted, which on most platforms indicates a maxvalue of 2^63-1 and -1 for ascending and descending sequences, respectively. .. versionadded:: 1.0.7 :param nominvalue: no minimum value of the sequence. This value is used when the CREATE SEQUENCE command is emitted to the database as the value of the "NO MINVALUE" clause. If ``None``, the clause is omitted, which on most platforms indicates a minvalue of 1 and -2^63-1 for ascending and descending sequences, respectively. .. versionadded:: 1.0.7 :param nomaxvalue: no maximum value of the sequence. This value is used when the CREATE SEQUENCE command is emitted to the database as the value of the "NO MAXVALUE" clause. If ``None``, the clause is omitted, which on most platforms indicates a maxvalue of 2^63-1 and -1 for ascending and descending sequences, respectively. .. versionadded:: 1.0.7 :param cycle: allows the sequence to wrap around when the maxvalue or minvalue has been reached by an ascending or descending sequence respectively. This value is used when the CREATE SEQUENCE command is emitted to the database as the "CYCLE" clause. If the limit is reached, the next number generated will be the minvalue or maxvalue, respectively. If cycle=False (the default) any calls to nextval after the sequence has reached its maximum value will return an error. .. versionadded:: 1.0.7 :param schema: optional schema name for the sequence, if located in a schema other than the default. The rules for selecting the schema name when a :class:`_schema.MetaData` is also present are the same as that of :paramref:`_schema.Table.schema`. :param cache: optional integer value; number of future values in the sequence which are calculated in advance. Renders the CACHE keyword understood by Oracle and PostgreSQL. .. versionadded:: 1.1.12 :param order: optional boolean value; if ``True``, renders the ORDER keyword, understood by Oracle, indicating the sequence is definitively ordered. May be necessary to provide deterministic ordering using Oracle RAC. .. versionadded:: 1.1.12 :param data_type: The type to be returned by the sequence, for dialects that allow us to choose between INTEGER, BIGINT, etc. (e.g., mssql). .. versionadded:: 1.4.0 :param optional: boolean value, when ``True``, indicates that this :class:`.Sequence` object only needs to be explicitly generated on backends that don't provide another way to generate primary key identifiers. Currently, it essentially means, "don't create this sequence on the PostgreSQL backend, where the SERIAL keyword creates a sequence for us automatically". :param quote: boolean value, when ``True`` or ``False``, explicitly forces quoting of the :paramref:`_schema.Sequence.name` on or off. When left at its default of ``None``, normal quoting rules based on casing and reserved words take place. :param quote_schema: Set the quoting preferences for the ``schema`` name. :param metadata: optional :class:`_schema.MetaData` object which this :class:`.Sequence` will be associated with. A :class:`.Sequence` that is associated with a :class:`_schema.MetaData` gains the following capabilities: * The :class:`.Sequence` will inherit the :paramref:`_schema.MetaData.schema` parameter specified to the target :class:`_schema.MetaData`, which affects the production of CREATE / DROP DDL, if any. * The :meth:`.Sequence.create` and :meth:`.Sequence.drop` methods automatically use the engine bound to the :class:`_schema.MetaData` object, if any. * The :meth:`_schema.MetaData.create_all` and :meth:`_schema.MetaData.drop_all` methods will emit CREATE / DROP for this :class:`.Sequence`, even if the :class:`.Sequence` is not associated with any :class:`_schema.Table` / :class:`_schema.Column` that's a member of this :class:`_schema.MetaData`. The above behaviors can only occur if the :class:`.Sequence` is explicitly associated with the :class:`_schema.MetaData` via this parameter. .. seealso:: :ref:`sequence_metadata` - full discussion of the :paramref:`.Sequence.metadata` parameter. :param for_update: Indicates this :class:`.Sequence`, when associated with a :class:`_schema.Column`, should be invoked for UPDATE statements on that column's table, rather than for INSERT statements, when no value is otherwise present for that column in the statement. RRkRlRmRnRoRpRqRrRsN(RIRlRjRRtoptionalR[RRRjRt_keyt _set_metadataRt data_type(R3RRkRlRmRnRoRpRqRRrRsRxRuRnRjRoR((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRlM s4  !  cC@stS(N(R\(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRZ scC@stS(N(R\(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR[ sssqlalchemy.sql.functionscC@sB|jr(tjjjj|d|jStjjjj|SdS(sReturn a :class:`.next_value` function element which will render the appropriate increment function for this :class:`.Sequence` within any SQL expression. RN(RRR]t sql_functionstfunct next_value(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR{ s cK@s*tt|j||j|jdS(N(R{RRRRC(R3RR5((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR scC@s|j|jdS(N(RwRj(R3RR!((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRC# scC@s ||_||jj|jRR]RR(R3Rtn((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR~u s  cK@s1||_|jr!||j_n ||j_dS(N(RRRR(R3RR5((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR| s  cC@s tj|S(N(RR<(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR= s(RCRDRERIRUR\t reflectedt has_argumentR[RlRR~RR=(((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRR s    RcB@s,eZdZeZeedZdZRS(s>A DDL-specified DEFAULT column value. :class:`.DefaultClause` is a :class:`.FetchedValue` that also generates a "DEFAULT" clause when "CREATE TABLE" is emitted. :class:`.DefaultClause` is generated automatically whenever the ``server_default``, ``server_onupdate`` arguments of :class:`_schema.Column` are used. A :class:`.DefaultClause` can be passed positionally as well. For example, the following:: Column('foo', Integer, server_default="50") Is equivalent to:: Column('foo', Integer, DefaultClause("50")) cC@sOtj|tjdttfdtt|j|||_||_ dS(NiRY( Rtassert_arg_typeRR RR{RRlRYR(R3RYRt _reflected((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRl s  cC@sd|j|jfS(Ns DefaultClause(%r, for_update=%r)(RYR(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR= s(RCRDRERIRR\RlR=(((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR st ConstraintcB@skeZdZdZd d d d d edZedZdZ e j dddZ dZ RS( srA table-level SQL constraint. :class:`_schema.Constraint` serves as the base class for the series of constraint objects that can be associated with :class:`_schema.Table` objects, including :class:`_schema.PrimaryKeyConstraint`, :class:`_schema.ForeignKeyConstraint` :class:`_schema.UniqueConstraint`, and :class:`_schema.CheckConstraint`. RcK@s]||_||_||_|r-||_n||_||_tj||j|dS(sVCreate a SQL constraint. :param name: Optional, the in-database name of this ``Constraint``. :param deferrable: Optional bool. If set, emit DEFERRABLE or NOT DEFERRABLE when issuing DDL for this constraint. :param initially: Optional string. If set, emit INITIALLY when issuing DDL for this constraint. :param info: Optional data dictionary which will be populated into the :attr:`.SchemaItem.info` attribute of this object. .. versionadded:: 1.0.0 :param \**dialect_kw: Additional keyword arguments are dialect specific, and passed in the form ``_``. See the documentation regarding an individual dialect at :ref:`dialect_toplevel` for detail on documented arguments. :param _create_rule: used internally by some datatypes that also create constraints. :param _type_bound: used internally to indicate that this constraint is associated with a specific datatype. N( RR%R&R;t _create_ruleRRRR(R3RR%R&RR;RR)((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRl s*       cC@sDyt|jtr|jSWntk r0nXtjddS(NsdThis constraint is not bound to a table. Did you mean to call table.append_constraint(constraint) ?(RR"RKR0RR`(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR! s  cK@s||_|jj|dS(N(R"R~R(R3R"R5((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR s s1.4saThe :meth:`_schema.Constraint.copy` method is deprecated and will be removed in a future release.cK@s |j|S(N(R(R3R5((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR? scK@s tdS(N(tNotImplementedError(R3R5((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR sN(RCRDRERFRR\RlRR!RRRR?R(((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR s  - tColumnCollectionMixincB@s;eZdZeZdZedZdZdZ RS(c O@s|jdt}|jdt|_t|_|jdd}|dk rg|_xttj t j |D]/\}}}}|jj ||j |qpWn+g|D]}tj t j |^q|_|r|jr|jndS(Nt _autoattachRt_gather_expressions(R]RIR\RRRRt_pending_colargsRt expect_col_expression_collectionRtDDLConstraintColumnRoleRRt _check_attach( R3RR5Rtprocessed_expressionsRRtstrnamet add_element((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRl s   (c @sgjD]}t|tr |^q }g|D]}t|jtr2|^q2}t|j|r| stdtdjDj|}|sfd}_xD]}|j |qWdSn|}d|D} t | dkr*j | j nt | dkrj r|dj} g|dD]}|j| k r^|^q^} | rtjddjd | D| jfqndS( Ns#Should not reach here on event callcs@s!|]}|dk r|VqdS(N(R(RR#((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pys ? sc@s<t|tr8j|s8jdtq8ndS(NR(RRKtdiscardRRI(RR!(t cols_wo_tableR3(sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt _col_attachedC s cS@sh|]}|jqS((R!(RR#((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pys S s iis(Column(s) %s are not part of table '%s'.s, cs@s|]}d|VqdS(s'%s'N((RR#((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pys ] s(RRR R!RKR|t differenceR7t_cols_wo_tableRR4R/R]t_allow_multiple_tablesRR2RR( R3RR#tcol_objst cols_w_tablethas_string_colsRR$RR^R!tothers((RR3sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR1 s4++    ,cC@s9g|jD]+}t|tjr/|j|n|^q S(N(RRRRR#(R3R!R$((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt_col_expressionsb scK@s=x6|j|D]%}|dk r|jj|qqWdS(N(RRRR(R3R!R5R$((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRh s N( RCRDRRR\RRlRRR(((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR s    1 tColumnCollectionConstraintcB@steZdZdZd ZdZdZej ddd dZ d dZ dZ d Z d ZRS( s-A constraint that proxies a ColumnCollection.cO@sT|jdt}|jdt}tj||tj|d|d||dS(sZ :param \*columns: A sequence of column names or Column objects. :param name: Optional, the in-database name of this constraint. :param deferrable: Optional bool. If set, emit DEFERRABLE or NOT DEFERRABLE when issuing DDL for this constraint. :param initially: Optional string. If set, emit INITIALLY when issuing DDL for this constraint. :param \**kw: other keyword arguments including dialect-specific arguments are propagated to the :class:`.Constraint` superclass. RRN(R]RIR\RRlR(R3RR5RR((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRlq s cK@s$tj||tj||dS(N(RRR(R3R!R5((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR scC@s ||jkS(N(R(R3R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt __contains__ ss1.4sqThe :meth:`_schema.ColumnCollectionConstraint.copy` method is deprecated and will be removed in a future release.cK@s|jd||S(NR&(R(R3R&R5((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR? sc K@si}xP|jD]E}|j|j}x,|jD]\}}|||d| when issuing DDL for this constraint. :param info: Optional data dictionary which will be populated into the :attr:`.SchemaItem.info` attribute of this object. .. versionadded:: 1.0.0 RRR%R&RR;RRN( RRRtDDLExpressionRoleRRttraverseRR{RRlRR/( R3RRR%R&R!R;RRRR5R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRl s/  cC@st|jt S(N(RR"RK(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pytis_column_levelss1.4sfThe :meth:`_schema.CheckConstraint.copy` method is deprecated and will be removed in a future release.cK@s|jd||S(NR&(R(R3R&R5((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR?scK@s|dk r't|j|j|}n |j}t|d|jd|jd|jd|jd|dt d|j }|j |S(NRR&R%RR!RR( RR*RR!RRR&R%RR\RRB(R3R&R5RR#((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR#s       N(RCRDRERIRRFR RR\RlRRRRR?R(((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR s*2Rc B@seZdZdZdddddeedddd ZdZdZdZ e dZ e dZ e dZ dZe dZe d Zd Zejd d ddd ZdddZRS(sA table-level FOREIGN KEY constraint. Defines a single column or composite FOREIGN KEY ... REFERENCES constraint. For a no-frills, single column foreign key, adding a :class:`_schema.ForeignKey` to the definition of a :class:`_schema.Column` is a shorthand equivalent for an unnamed, single column :class:`_schema.ForeignKeyConstraint`. Examples of foreign key configuration are in :ref:`metadata_foreignkeys`. tforeign_key_constraintc K@stj|d|d|d|d| | ||_||_| |_||_| |_tt|t|krtt|t|krt j dqt j dng|D]f}t |d|d|j d|jd |jd |jd |jd |jd|j d|j|j ^q|_tj||| dk r~t|d rn| |jksntn|j| ndS(s- Construct a composite-capable FOREIGN KEY. :param columns: A sequence of local column names. The named columns must be defined and present in the parent Table. The names should match the ``key`` given to each column (defaults to the name) unless ``link_to_name`` is True. :param refcolumns: A sequence of foreign column names or Column objects. The columns must all be located within the same Table. :param name: Optional, the in-database name of the key. :param onupdate: Optional string. If set, emit ON UPDATE when issuing DDL for this constraint. Typical values include CASCADE, DELETE and RESTRICT. :param ondelete: Optional string. If set, emit ON DELETE when issuing DDL for this constraint. Typical values include CASCADE, DELETE and RESTRICT. :param deferrable: Optional bool. If set, emit DEFERRABLE or NOT DEFERRABLE when issuing DDL for this constraint. :param initially: Optional string. If set, emit INITIALLY when issuing DDL for this constraint. :param link_to_name: if True, the string name given in ``column`` is the rendered name of the referenced column, not its locally assigned ``key``. :param use_alter: If True, do not emit the DDL for this constraint as part of the CREATE TABLE definition. Instead, generate it via an ALTER TABLE statement issued after the full collection of tables have been created, and drop it via an ALTER TABLE statement before the full collection of tables are dropped. The use of :paramref:`_schema.ForeignKeyConstraint.use_alter` is particularly geared towards the case where two or more tables are established within a mutually-dependent foreign key constraint relationship; however, the :meth:`_schema.MetaData.create_all` and :meth:`_schema.MetaData.drop_all` methods will perform this resolution automatically, so the flag is normally not needed. .. versionchanged:: 1.0.0 Automatic resolution of foreign key cycles has been added, removing the need to use the :paramref:`_schema.ForeignKeyConstraint.use_alter` in typical use cases. .. seealso:: :ref:`use_alter` :param match: Optional string. If set, emit MATCH when issuing DDL for this constraint. Typical values include SIMPLE, PARTIAL and FULL. :param info: Optional data dictionary which will be populated into the :attr:`.SchemaItem.info` attribute of this object. .. versionadded:: 1.0.0 :param \**dialect_kw: Additional keyword arguments are dialect specific, and passed in the form ``_``. See the documentation regarding an individual dialect at :ref:`dialect_toplevel` for detail on documented arguments. .. versionadded:: 0.9.2 RR%R&R;sOForeignKeyConstraint with duplicate source column references are not supported.s_ForeignKeyConstraint number of constrained columns must match the number of referenced columns.RRR$R#RR'R"N(RRlRR$RR#R'R4R|RR2RRR%R&tdialect_kwargstelementsRRRR"R7R/(R3Rt refcolumnsRRR$R%R&R#RR'R!R;R)trefcol((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRlHs2W        s cC@s$|jj||jj|dS(N(RRRR(R3RR((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRGscC@stjt|j|jS(N(Rt OrderedDicttzipt column_keysR(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt _elementsscC@s x|jD] }|jSWdSdS(N(RRR(R3telem((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRscC@s|jdjjS(slThe :class:`_schema.Table` object to which this :class:`_schema.ForeignKeyConstraint` references. This is a dynamically calculated attribute which may not be available if the constraint and/or parent table is not yet associated with a metadata collection that contains the referred table. .. versionadded:: 1.0.0 i(RRR!(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pytreferred_tables cC@stg|jD]}|j^q }d|krt|dkrt|dd!\}}tjd|j|j ||fndS(NiiisJForeignKeyConstraint on %s(%s) refers to multiple remote tables: %s and %s( R|RR0RR4RRR2Rt_col_description(R3R!Rt table_keystelem0telem1((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRDs (cC@sXt|dr|jjSg|jD]*}t|trD|jn t|^q&SdS(sReturn a list of string keys representing the local columns in this :class:`_schema.ForeignKeyConstraint`. This list is either the original string arguments sent to the constructor of the :class:`_schema.ForeignKeyConstraint`, or if the constraint has been initialized with :class:`_schema.Column` objects, is the string ``.key`` of each element. .. versionadded:: 1.0.0 R"N(RRtkeysRRRR"tstr(R3R$((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRs  cC@sdj|jS(Ns, (RR(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR'scK@stj||ytj||WnCtk ri}tjtjd|j|j dfd|nXxRt |j |j D];\}}t |d s|j|k r|j|qqW|j|dS(NsQCan't create ForeignKeyConstraint on table '%s': no column named '%s' is present.iRR"(RRRtKeyErrorRR1RR2RR4RRRRR"R/RD(R3R!R5tkeR$R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR+s "s1.4skThe :meth:`_schema.ForeignKeyConstraint.copy` method is deprecated and will be removed in a future release.cK@s|jd|d||S(NRR&(R(R3RR&R5((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR?@scK@s tg|jD]}|jj^q g|jD]N}|jd|d|dk rq|j|jjjkrq|jnd^q,d|jd|j d|j d|j d|j d|j d |jd |j}x0t|j|jD]\}}|j|qW|j|S( NRR,RRR$R#R%R&RR'(RRR"R"R*RR0R!RRR$R#R%R&RR'RRB(R3RR&R5RRtself_fktother_fk((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRHs[        "N(RCRDRERFRR\RlRGRRRRRRRDRRRRRR?R(((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR8s6     RcB@sYeZdZdZdZdZdZdZedZ e j dZ RS(s A table-level PRIMARY KEY constraint. The :class:`.PrimaryKeyConstraint` object is present automatically on any :class:`_schema.Table` object; it is assigned a set of :class:`_schema.Column` objects corresponding to those marked with the :paramref:`_schema.Column.primary_key` flag:: >>> my_table = Table('mytable', metadata, ... Column('id', Integer, primary_key=True), ... Column('version_id', Integer, primary_key=True), ... Column('data', String(50)) ... ) >>> my_table.primary_key PrimaryKeyConstraint( Column('id', Integer(), table=, primary_key=True, nullable=False), Column('version_id', Integer(), table=, primary_key=True, nullable=False) ) The primary key of a :class:`_schema.Table` can also be specified by using a :class:`.PrimaryKeyConstraint` object explicitly; in this mode of usage, the "name" of the constraint can also be specified, as well as other options which may be recognized by dialects:: my_table = Table('mytable', metadata, Column('id', Integer), Column('version_id', Integer), Column('data', String(50)), PrimaryKeyConstraint('id', 'version_id', name='mytable_pk') ) The two styles of column-specification should generally not be mixed. An warning is emitted if the columns present in the :class:`.PrimaryKeyConstraint` don't match the columns that were marked as ``primary_key=True``, if both are present; in this case, the columns are taken strictly from the :class:`.PrimaryKeyConstraint` declaration, and those columns otherwise marked as ``primary_key=True`` are ignored. This behavior is intended to be backwards compatible with previous behavior. .. versionchanged:: 0.9.2 Using a mixture of columns within a :class:`.PrimaryKeyConstraint` in addition to columns marked as ``primary_key=True`` now emits a warning if the lists don't match. The ultimate behavior of ignoring those columns marked with the flag only is currently maintained for backwards compatibility; this warning may raise an exception in a future release. For the use case where specific options are to be specified on the :class:`.PrimaryKeyConstraint`, but the usual style of using ``primary_key=True`` flags is still desirable, an empty :class:`.PrimaryKeyConstraint` may be specified, which will take on the primary key column collection from the :class:`_schema.Table` based on the flags:: my_table = Table('mytable', metadata, Column('id', Integer, primary_key=True), Column('version_id', Integer, primary_key=True), Column('data', String(50)), PrimaryKeyConstraint(name='mytable_pk', mssql_clustered=True) ) .. versionadded:: 0.9.2 an empty :class:`.PrimaryKeyConstraint` may now be specified for the purposes of establishing keyword arguments with the constraint, independently of the specification of "primary key" columns within the :class:`_schema.Table` itself; columns marked as ``primary_key=True`` will be gathered into the empty constraint's column collection. tprimary_key_constraintcO@s2|jdt|_tt|j||dS(NRp(R]R\RpR{RRl(R3RR5((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRlscK@satt|j||j|k rT|jj|j||_|jj|ng|jD]}|jr^|^q^}|jr |r t |t |jkr t j d|j dj d|Ddj d|jDdj d|jDfg|(nx5|jD]*}t|_|jtkrt|_qqW|r]|jj|ndS(NsTable '%s' specifies columns %s as primary_key=True, not matching locally specified columns %s; setting the current primary key columns to %s. This warning may become an exception in a future releases, cs@s|]}d|jVqdS(s'%s'N(R(RR#((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pys scs@s|]}d|jVqdS(s'%s'N(R(RR#((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pys scs@s|]}d|jVqdS(s'%s'N(R(RR#((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pys s(R{RRRR~RRR#RR|RRRRRIRRR\Rtextend(R3R!R5R#t table_pks((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRs( %*!  cC@sNx|D]}t|_qW|jj|tjj||j|jdS(sKrepopulate this :class:`.PrimaryKeyConstraint` given a set of columns. Existing columns in the table that are marked as primary_key=True are maintained. Also fires a new event. This is basically like putting a whole new :class:`.PrimaryKeyConstraint` object on the parent :class:`_schema.Table` object without actually replacing the object. The ordering of the given list of columns is also maintained; these columns will be appended to the list of columns after any which are already present. N( RIRRRRRt_resetR/R!(R3RR$((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt_reloads   cC@s7tjj||jj||jj||dS(N(RRRRR'R@t'_sa_event_column_added_to_pk_constraint(R3R$((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRscC@sS|j}|dk rB|gg|jD]}||k r%|^q%St|jSdS(N(RRRR(R3tautoincR#((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pytcolumns_autoinc_firsts  -cC@sd}t|jdkrvt|jd}|jtkrQ||t|S|jdkr||tr|Snqd}xd|jD]Y}|jtkr||t|dk rtjd|j |j fq|}qqW|SdS(NcS@s|jjdks:t|jjtjjtjjf rf|r_tjd|j|fqt Snyt |j tdt f r| rt S|j dk rt |j t r| rt S|jr|jtdfkrt StS(NsGColumn type %s on column '%s' is not compatible with autoincrement=Truet ignore_fk(Rt_type_affinityRt issubclassRt INTEGERTYPEt NUMERICTYPERR2R\RR-RRRRRRI(R$t autoinc_true((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt_validate_autoincs*   iiRRsGOnly one Column may be marked autoincrement=True, found both %s and %s.(RR( R4RRRRIR\RRR2R(R3RR$R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRs* !     ( RCRDRERFRlRRRRRRRHR(((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRcsH     RcB@seZdZdZRS(sA table-level UNIQUE constraint. Defines a single column or composite UNIQUE constraint. For a no-frills, single column constraint, adding ``unique=True`` to the ``Column`` definition is a shorthand equivalent for an unnamed, single column UniqueConstraint. tunique_constraint(RCRDRERF(((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRBsRcB@s\eZdZdZdZdZedZde dZ de dZ dZ RS( s A table-level INDEX. Defines a composite (one or more column) INDEX. E.g.:: sometable = Table("sometable", metadata, Column("name", String(50)), Column("address", String(100)) ) Index("some_index", sometable.c.name) For a no-frills, single column index, adding :class:`_schema.Column` also supports ``index=True``:: sometable = Table("sometable", metadata, Column("name", String(50), index=True) ) For a composite index, multiple columns can be specified:: Index("some_index", sometable.c.name, sometable.c.address) Functional indexes are supported as well, typically by using the :data:`.func` construct in conjunction with table-bound :class:`_schema.Column` objects:: Index("some_index", func.lower(sometable.c.name)) An :class:`.Index` can also be manually associated with a :class:`_schema.Table`, either through inline declaration or using :meth:`_schema.Table.append_constraint`. When this approach is used, the names of the indexed columns can be specified as strings:: Table("sometable", metadata, Column("name", String(50)), Column("address", String(100)), Index("some_index", "name", "address") ) To support functional or expression-based indexes in this form, the :func:`_expression.text` construct may be used:: from sqlalchemy import text Table("sometable", metadata, Column("name", String(50)), Column("address", String(100)), Index("some_index", text("lower(name)")) ) .. versionadded:: 0.9.5 the :func:`_expression.text` construct may be used to specify :class:`.Index` expressions, provided the :class:`.Index` is explicitly associated with the :class:`_schema.Table`. .. seealso:: :ref:`schema_indexes` - General information on :class:`.Index`. :ref:`postgresql_indexes` - PostgreSQL-specific options available for the :class:`.Index` construct. :ref:`mysql_indexes` - MySQL-specific options available for the :class:`.Index` construct. :ref:`mssql_indexes` - MSSQL-specific options available for the :class:`.Index` construct. RcO@sd|_}t||jdd|_|jdt|_|jdt}d|krs|jd|_nd|kr|jd}n|j|g|_ t j |d|d|j ||dk r|j |ndS(sConstruct an index object. :param name: The name of the index :param \*expressions: Column expressions to include in the index. The expressions are normally instances of :class:`_schema.Column`, but may also be arbitrary SQL expressions which ultimately refer to a :class:`_schema.Column`. :param unique=False: Keyword only argument; if True, create a unique index. :param quote=None: Keyword only argument; whether to apply quoting to the name of the index. Works in the same manner as that of :paramref:`_schema.Column.quote`. :param info=None: Optional data dictionary which will be populated into the :attr:`.SchemaItem.info` attribute of this object. .. versionadded:: 1.0.0 :param \**kw: Additional keyword arguments not mentioned above are dialect specific, and passed in the form ``_``. See the documentation regarding an individual dialect at :ref:`dialect_toplevel` for detail on documented arguments. RnRRR;RRN( RR!RR]RR\RR;RRRRlR(R3RRR5R!R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRls       cK@stj|||jdk rY||jk rYtjd|j|jj|jfn||_|jj ||j }|j |}t |t |kst gt||D]'\}}t|tr|n|^q|_ dS(NsKIndex '%s' is against table '%s', and cannot be associated with table '%s'.(RRR!RRR2RRR}RRRR4R7RRR (R3R!R5Rtcol_expressionsRtcolexpr((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRs"  cC@s |jjS(s2Return the connectable associated with this Index.(R!R(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRscC@s8|dkrt|}n|jtj|d||S(s&Issue a ``CREATE`` statement for this :class:`.Index`, using the given :class:`.Connectable` for connectivity. .. note:: the "bind" argument will be required in SQLAlchemy 2.0. .. seealso:: :meth:`_schema.MetaData.create_all`. RN(RRRRR(R3RR((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRs cC@s8|dkrt|}n|jtj|d|dS(s"Issue a ``DROP`` statement for this :class:`.Index`, using the given :class:`.Connectable` for connectivity. .. note:: the "bind" argument will be required in SQLAlchemy 2.0. .. seealso:: :meth:`_schema.MetaData.drop_all`. RN(RRRRR(R3RR((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRs cC@sSddjt|jgg|jD]}t|^q"|jrJdgpMgS(Ns Index(%s)s, s unique=True(RRRRR(R3te((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR=sN( RCRDRERFRlRRRRR\RRR=(((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRNsJ < six_%(column_0_label)stixtMetaDatacB@seZdZdZejddddddddZdZdZ dZ dZ d Z d Z d Zd Zd ZejddZeeeZdZdZedZddedeeedZddedZddedZRS(sDA collection of :class:`_schema.Table` objects and their associated schema constructs. Holds a collection of :class:`_schema.Table` objects as well as an optional binding to an :class:`_engine.Engine` or :class:`_engine.Connection`. If bound, the :class:`_schema.Table` objects in the collection and their columns may participate in implicit SQL execution. The :class:`_schema.Table` objects themselves are stored in the :attr:`_schema.MetaData.tables` dictionary. :class:`_schema.MetaData` is a thread-safe object for read operations. Construction of new tables within a single :class:`_schema.MetaData` object, either explicitly or via reflection, may not be completely thread-safe. .. seealso:: :ref:`metadata_describing` - Introduction to database metadata RjRs2.0scThe :paramref:`_schema.MetaData.bind` argument is deprecated and will be removed in SQLAlchemy 2.0.cC@s|tj|_t|||_|r-|nt|_|rH||_nt|_ i|_ t j t |_||_dS(s>Create a new MetaData object. :param bind: An Engine or Connection to bind to. May also be a string or URL instance, these are passed to :func:`_sa.create_engine` and this :class:`_schema.MetaData` will be bound to the resulting engine. :param schema: The default schema to use for the :class:`_schema.Table`, :class:`.Sequence`, and potentially other objects associated with this :class:`_schema.MetaData`. Defaults to ``None``. .. seealso:: :ref:`schema_metadata_schema_name` - details on how the :paramref:`_schema.MetaData.schema` parameter is used. :paramref:`_schema.Table.schema` :paramref:`.Sequence.schema` :param quote_schema: Sets the ``quote_schema`` flag for those :class:`_schema.Table`, :class:`.Sequence`, and other objects which make usage of the local ``schema`` name. :param info: Optional data dictionary which will be populated into the :attr:`.SchemaItem.info` attribute of this object. .. versionadded:: 1.0.0 :param naming_convention: a dictionary referring to values which will establish default naming conventions for :class:`.Constraint` and :class:`.Index` objects, for those objects which are not given a name explicitly. The keys of this dictionary may be: * a constraint or Index class, e.g. the :class:`.UniqueConstraint`, :class:`_schema.ForeignKeyConstraint` class, the :class:`.Index` class * a string mnemonic for one of the known constraint classes; ``"fk"``, ``"pk"``, ``"ix"``, ``"ck"``, ``"uq"`` for foreign key, primary key, index, check, and unique constraint, respectively. * the string name of a user-defined "token" that can be used to define new naming tokens. The values associated with each "constraint class" or "constraint mnemonic" key are string naming templates, such as ``"uq_%(table_name)s_%(column_0_name)s"``, which describe how the name should be composed. The values associated with user-defined "token" keys should be callables of the form ``fn(constraint, table)``, which accepts the constraint/index object and :class:`_schema.Table` as arguments, returning a string result. The built-in names are as follows, some of which may only be available for certain types of constraint: * ``%(table_name)s`` - the name of the :class:`_schema.Table` object associated with the constraint. * ``%(referred_table_name)s`` - the name of the :class:`_schema.Table` object associated with the referencing target of a :class:`_schema.ForeignKeyConstraint`. * ``%(column_0_name)s`` - the name of the :class:`_schema.Column` at index position "0" within the constraint. * ``%(column_0N_name)s`` - the name of all :class:`_schema.Column` objects in order within the constraint, joined without a separator. * ``%(column_0_N_name)s`` - the name of all :class:`_schema.Column` objects in order within the constraint, joined with an underscore as a separator. * ``%(column_0_label)s``, ``%(column_0N_label)s``, ``%(column_0_N_label)s`` - the label of either the zeroth :class:`_schema.Column` or all :class:`.Columns`, separated with or without an underscore * ``%(column_0_key)s``, ``%(column_0N_key)s``, ``%(column_0_N_key)s`` - the key of either the zeroth :class:`_schema.Column` or all :class:`.Columns`, separated with or without an underscore * ``%(referred_column_0_name)s``, ``%(referred_column_0N_name)s`` ``%(referred_column_0_N_name)s``, ``%(referred_column_0_key)s``, ``%(referred_column_0N_key)s``, ... column tokens which render the names/keys/labels of columns that are referenced by a :class:`_schema.ForeignKeyConstraint`. * ``%(constraint_name)s`` - a special key that refers to the existing name given to the constraint. When this key is present, the :class:`.Constraint` object's existing name will be replaced with one that is composed from template string that uses this token. When this token is present, it is required that the :class:`.Constraint` is given an explicit name ahead of time. * user-defined: any additional token may be implemented by passing it along with a ``fn(constraint, table)`` callable to the naming_convention dictionary. .. versionadded:: 1.3.0 - added new ``%(column_0N_name)s``, ``%(column_0_N_name)s``, and related tokens that produce concatenations of names, keys, or labels for all columns referred to by a given constraint. .. seealso:: :ref:`constraint_naming_conventions` - for detailed usage examples. N(Rt FacadeDictR^RRtDEFAULT_NAMING_CONVENTIONtnaming_conventionR;R|t_schemasR|t collectionst defaultdictRRR(R3RRRoRR;((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRl=s     cC@s|jrd|jSdSdS(NsMetaData(bind=%r)s MetaData()(R(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR=s  cC@s+t|tjs|j}n||jkS(N(RRRR"R^(R3t table_or_key((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRs cC@s?t||}|jj|||r;|jj|ndS(N(RR^t _insert_itemRR(R3RRR!R"((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRcscC@st||}tj|j|d}|dk rWx!|jD]}|j|q=Wn|jrtg|jj D]}|j dk rs|j ^qs|_ndS(N( RtdictR]R^RRRFRR|tvaluesR(R3RRR"tremovedRtt((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRhs  cC@s@i|jd6|jd6|jd6|jd6|jd6|jd6S(NR^Rtschemast sequencestfk_memosR(R^RRR|RR(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt __getstate__s     cC@s[|d|_|d|_|d|_d|_|d|_|d|_|d|_dS(NR^RRRRR(R^RRRt_bindR|RR(R3tstate((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt __setstate__s      cC@s |jdk S(s:True if this MetaData is bound to an Engine or Connection.N(RR(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pytis_boundscC@s|jS(sAn :class:`_engine.Engine` or :class:`_engine.Connection` to which this :class:`_schema.MetaData` is bound. Typically, a :class:`_engine.Engine` is assigned to this attribute so that "implicit execution" may be used, or alternatively as a means of providing engine binding information to an ORM :class:`.Session` object:: engine = create_engine("someurl://") metadata.bind = engine .. deprecated :: 1.4 The metadata.bind attribute, as part of the deprecated system of "implicit execution", is itself deprecated and will be removed in SQLAlchemy 2.0. .. seealso:: :ref:`dbengine_implicit` - background on "bound metadata" (R(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRsssqlalchemy.engine.urlcC@sJtjj}t|tj|jfr=tj||_n ||_dS(s;Bind this MetaData to an Engine, Connection, string or URL.N( RR]t engine_urlRRtURLt sqlalchemyt create_engineR(R3Rturl((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt_bind_to9s cC@s.tj|j|jj|jjdS(s+Clear all Table objects from this MetaData.N(RtclearR^RR(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRDs cC@s|j|j|jdS(s1Remove the given Table object from this MetaData.N(RhRR(R3R!((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRKscC@s%tjt|jjddS(sReturns a list of :class:`_schema.Table` objects sorted in order of foreign key dependency. The sorting will place :class:`_schema.Table` objects that have dependencies first, before the dependencies themselves, representing the order in which they can be created. To get the order in which the tables would be dropped, use the ``reversed()`` Python built-in. .. warning:: The :attr:`.MetaData.sorted_tables` attribute cannot by itself accommodate automatic resolution of dependency cycles between tables, which are usually caused by mutually dependent foreign key constraints. When these cycles are detected, the foreign keys of these tables are omitted from consideration in the sort. A warning is emitted when this condition occurs, which will be an exception raise in a future release. Tables which are not part of the cycle will still be returned in dependency order. To resolve these cycles, the :paramref:`_schema.ForeignKeyConstraint.use_alter` parameter may be applied to those constraints which create a cycle. Alternatively, the :func:`_schema.sort_tables_and_constraints` function will automatically return foreign key constraints in a separate collection when cycles are detected so that they may be applied to a schema separately. .. versionchanged:: 1.3.17 - a warning is emitted when :attr:`.MetaData.sorted_tables` cannot perform a proper sort due to cyclical dependencies. This will be an exception in a future release. Additionally, the sort will continue to return other tables not involved in the cycle in dependency order which was not the case previously. .. seealso:: :func:`_schema.sort_tables` :func:`_schema.sort_tables_and_constraints` :attr:`_schema.MetaData.tables` :meth:`_reflection.Inspector.get_table_names` :meth:`_reflection.Inspector.get_sorted_table_and_fkc_names` R"cS@s|jS(N(R"(R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRRm(Rt sort_tablesRR^R(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt sorted_tablesPs3c K@s|d krt|}ntj|j} i| d6|d6|d6|d6td6} | j||d kr|j}n|d k r|| d_``. See the documentation regarding an individual dialect at :ref:`dialect_toplevel` for detail on documented arguments. .. versionadded:: 0.9.2 - Added :paramref:`.MetaData.reflect.**dialect_kwargs` to support dialect-level reflection options for all :class:`_schema.Table` objects reflected. RqRTRrRtRsRs%s.%ss schema '%s'RmsACould not reflect: requested table(s) not available in %r%s: (%s)s, sSkipping table %s: %sN(RRRRRR|RRRt OrderedSettget_table_namestget_view_namesR^RRWRR`tengineRRKtUnreflectableTableErrorR(R3RRtviewstonlyRTRrRtRRt reflect_optst availableRtavailable_w_schematcurrenttschnametloadtmissingtstuerr((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pytreflectsZ`        ) ! %"  cC@s>|dkrt|}n|jtj|d|d|dS(sCreate all tables stored in this metadata. Conditional by default, will not attempt to recreate tables already present in the target database. :param bind: A :class:`.Connectable` used to access the database; if None, uses the existing bind on this ``MetaData``, if any. .. note:: the "bind" argument will be required in SQLAlchemy 2.0. :param tables: Optional list of ``Table`` objects, which is a subset of the total tables in the ``MetaData`` (others are ignored). :param checkfirst: Defaults to True, don't issue CREATEs for tables already present in the target database. RR^N(RRRRR(R3RR^R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyt create_all)s cC@s>|dkrt|}n|jtj|d|d|dS(sDrop all tables stored in this metadata. Conditional by default, will not attempt to drop tables not present in the target database. :param bind: A :class:`.Connectable` used to access the database; if None, uses the existing bind on this ``MetaData``, if any. .. note:: the "bind" argument will be required in SQLAlchemy 2.0. :param tables: Optional list of ``Table`` objects, which is a subset of the total tables in the ``MetaData`` (others are ignored). :param checkfirst: Defaults to True, only issue DROPs for tables confirmed to be present in the target database. RR^N(RRRRR(R3RR^R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pytdrop_allFs (s2.0scThe :paramref:`_schema.MetaData.bind` argument is deprecated and will be removed in SQLAlchemy 2.0.N(RCRDRERFRRRRlR^R=RRcRhRRRRRiRRRRRR\RIRRR(((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR"sB          9 s1.4sT:class:`.ThreadLocalMetaData` is deprecated and will be removed in a future release.t constructorRltThreadLocalMetaDatacB@s_eZdZdZdZdZejddZe eeZdZ dZ RS(sA MetaData variant that presents a different ``bind`` in every thread. Makes the ``bind`` property of the MetaData a thread-local value, allowing this collection of tables to be bound to different ``Engine`` implementations or connections in each thread. The ThreadLocalMetaData starts off bound to None in each thread. Binds must be made explicitly by assigning to the ``bind`` property or using ``connect()``. You can also re-bind dynamically multiple times per thread, just like a regular ``MetaData``. RjcC@s2tjj|_i|_tt|jdS(s Construct a ThreadLocalMetaData.N(Rt threadingtlocaltcontextt_ThreadLocalMetaData__enginesR{RRl(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRlzs cC@st|jddS(sThe bound Engine or Connection for this thread. This property may be assigned an Engine or Connection, or assigned a string or URL to automatically create a basic Engine for this bind with ``create_engine()``.t_engineN(RRR(R3((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRsssqlalchemy.engine.urlcC@stjj}t|tj|jfr~y|j||j_Wqt k rzt j |}||j|<||j_qXn+||jkr||j|t|jtdtf rPtjdn||_||_ ||j_||j_dS(NsPA generated column cannot specify a server_default or a server_onupdate argument( RRRRRRRR2RR(R3R"R5((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRs    cC@s|S(N((R3R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRss1.4s_The :meth:`_schema.Computed.copy` method is deprecated and will be removed in a future release.cK@s|j||S(N(R(R3R&R5((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR?scK@sRt|j|jdk r$|jjnd|}t|d|j}|j|S(NR (R*RRRR!RR RB(R3R&R5Rtg((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRs  N( RCRDRERFR RRlRRRRR?R(((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRs ! Rc B@steZdZdZed d d d d d d d d d d ZdZdZe j dddZ dZ RS( sDefines an identity column, i.e. "GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY" syntax. The :class:`.Identity` construct is an inline construct added to the argument list of a :class:`_schema.Column` object:: from sqlalchemy import Identity Table('foo', metadata_obj, Column('id', Integer, Identity()) Column('description', Text), ) See the linked documentation below for complete details. .. versionadded:: 1.4 .. seealso:: :ref:`identity_ddl` tidentity_columnc C@sbtj|d|d|d|d|d|d|d| d| d |  ||_||_d |_d S( shConstruct a GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY DDL construct to accompany a :class:`_schema.Column`. See the :class:`.Sequence` documentation for a complete description of most parameters. .. note:: MSSQL supports this construct as the preferred alternative to generate an IDENTITY on a column, but it uses non standard syntax that only support :paramref:`_schema.Identity.start` and :paramref:`_schema.Identity.increment`. All other parameters are ignored. :param always: A boolean, that indicates the type of identity column. If ``False`` is specified, the default, then the user-specified value takes precedence. If ``True`` is specified, a user-specified value is not accepted ( on some backends, like PostgreSQL, OVERRIDING SYSTEM VALUE, or similar, may be specified in an INSERT to override the sequence value). Some backends also have a default value for this parameter, ``None`` can be used to omit rendering this part in the DDL. It will be treated as ``False`` if a backend does not have a default value. :param on_null: Set to ``True`` to specify ON NULL in conjunction with a ``always=False`` identity column. This option is only supported on some backends, like Oracle. :param start: the starting index of the sequence. :param increment: the increment value of the sequence. :param minvalue: the minimum value of the sequence. :param maxvalue: the maximum value of the sequence. :param nominvalue: no minimum value of the sequence. :param nomaxvalue: no maximum value of the sequence. :param cycle: allows the sequence to wrap around when the maxvalue or minvalue has been reached. :param cache: optional integer value; number of future values in the sequence which are calculated in advance. :param order: optional boolean value; if true, renders the ORDER keyword. RkRlRmRnRoRpRqRrRsN(RjRltalwayston_nullRR( R3RRRkRlRmRnRoRpRqRrRs((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRl's;  cK@st|jtdtf s8t|jtd rJtjdn|jt krktjdn||_ ||_ |j t krt |_n||_dS(Ns^A column with an Identity object cannot specify a server_default or a server_onupdate argumentsCA column with an Identity object cannot specify autoincrement=False(RRRRRRRR2RR\RRRRR(R3R"R5((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRrs     cC@s|S(N((R3R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRss1.4s_The :meth:`_schema.Identity.copy` method is deprecated and will be removed in a future release.cK@s |j|S(N(R(R3R5((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR?scK@sytd|jd|jd|jd|jd|jd|jd|jd|jd |j d |j d |j }|j |S( NRRRkRlRmRnRoRpRqRrRs( RRRRkRlRmRnRoRpRqRrRsRB(R3R5ti((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyRs           N( RCRDRERFR\RRlRRRRR?R(((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyR s& ?  (BREt __future__RRRRmRRRRRtbaseRRRR R R RR R RRRRRRRRRRRtsymbolRR[RRR*t_self_inspectst VisitableR+RKR RRIRRVRjRRRRRRRRRRRt immutabledictRRtdeprecated_clsRRR(((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/schema.pyts       0 0q5+ 4$^e^l, D C`