Edit File: base.cpython-37.pyc
B ��4]fw � � @ s� d Z ddlZddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddlm Z dd lmZ dd lm Z ddlmZ ddlmZ dd lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ edddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�g�ZG d�d�� d�ej�ZG d�d�� d�eej �Z G �d �d� �deej!�Z!G �d�d� �dej"�Z#ej"e#iZ$eeeeeeeeeee e!e�d� Z%G �d�d� �dej&�Z'G �d�d� �dejj(�Z)G �d �d � �d ejj*�Z+G �d�d� �dejj,�Z-G �d �d� �de j.�Z/G �d�d� �de j0�Z1dS ( a� .. dialect:: firebird :name: Firebird .. note:: The Firebird dialect within SQLAlchemy **is not currently supported**. The dialect is not tested within continuous integration and is likely to have many issues and caveats not currently handled. Firebird Dialects ----------------- Firebird offers two distinct dialects_ (not to be confused with a SQLAlchemy ``Dialect``): dialect 1 This is the old syntax and behaviour, inherited from Interbase pre-6.0. dialect 3 This is the newer and supported syntax, introduced in Interbase 6.0. The SQLAlchemy Firebird dialect detects these versions and adjusts its representation of SQL accordingly. However, support for dialect 1 is not well tested and probably has incompatibilities. Locking Behavior ---------------- Firebird locks tables aggressively. For this reason, a DROP TABLE may hang until other transactions are released. SQLAlchemy does its best to release transactions as quickly as possible. The most common cause of hanging transactions is a non-fully consumed result set, i.e.:: result = engine.execute("select * from table") row = result.fetchone() return Where above, the ``ResultProxy`` has not been fully consumed. The connection will be returned to the pool and the transactional state rolled back once the Python garbage collector reclaims the objects which hold onto the connection, which often occurs asynchronously. The above use case can be alleviated by calling ``first()`` on the ``ResultProxy`` which will fetch the first row and immediately close all remaining cursor/connection resources. RETURNING support ----------------- Firebird 2.0 supports returning a result set from inserts, and 2.1 extends that to deletes and updates. This is generically exposed by the SQLAlchemy ``returning()`` method, such as:: # INSERT..RETURNING result = table.insert().returning(table.c.col1, table.c.col2).\ values(name='foo') print result.fetchall() # UPDATE..RETURNING raises = empl.update().returning(empl.c.id, empl.c.salary).\ where(empl.c.sales>100).\ values(dict(salary=empl.c.salary * 1.1)) print raises.fetchall() .. _dialects: http://mc-computing.com/Databases/Firebird/SQL_Dialect.html � N)�exc)�sql)�types)�util)�default)� reflection)�compiler)� expression)�quoted_name)�BIGINT)�BLOB)�DATE)�FLOAT)�INTEGER)�Integer)�NUMERIC)�SMALLINT)�TEXT)�TIME)� TIMESTAMPZactive�addZadmin�after�allZalter�and�any�asZascZ ascendingZat�auto�avg�before�beginZbetweenZbigint� bit_lengthZblobZbothZby�case�cast�char� characterZcharacter_length�char_length�check�close�collate�columnZcommitZ committedZcomputedZconditional�connectZ constraintZ containing�count�createZcrossZcstring�currentZcurrent_connectionZcurrent_dateZcurrent_roleZcurrent_timeZcurrent_timestampZcurrent_transactionZcurrent_userZcursorZdatabase�date�day�decZdecimalZdeclarer �delete�descZ descendingZ disconnectZdistinctZdo�domainZdouble�drop�else�endZentry_point�escape� exception�execute�exists�exitZexternal�extractZfetch�file�filter�float�forZforeign�from�full�functionZgdscode� generatorZgen_id�globalZgrant�groupZhaving�hour�if�inZinactive�index�innerZ input_typeZinsensitive�insert�int�integerZinto�isZ isolation�join�keyZleading�left�length�levelZlike�long�lowerZmanual�maxZmaximum_segment�merge�min�minute�module_name�month�namesZnationalZnaturalZnchar�no�not�nullZnumericZoctet_lengthZof�on�only�open�option�or�orderZouter�output_typeZoverflowZpageZpagesZ page_sizeZ parameter�passwordZplan�positionZ post_event� precisionZprimaryZ privilegesZ procedureZ protectedz rdb$db_key�read�realZrecord_versionZrecreate� recursiveZ references�releaseZreservZ reservingZretainZreturning_valuesZreturnsZrevoke�rightZrollbackZrowsZ row_countZ savepoint�schema�secondZsegment�selectZ sensitive�setZshadow�sharedZsingular�sizeZsmallintZsnapshotZsome�sortZsqlcodeZ stability�startZstartingZstartsZ statisticsZsub_type�sumZsuspend�tableZthen�time� timestamp�toZtrailingZtransactionZtriggerZtrimZuncommitted�union�unique�update�upper�userZusing�value�valuesZvarchar�variableZvarying�view�waitZwhen�where�while�withZwork�write�yearc s"