Files
Home-AssistantConfig/deps/sqlalchemy/dialects/sqlite/__pycache__/base.cpython-34.pyc

706 lines
49 KiB
Plaintext
Raw Normal View History

2016-10-11 16:42:06 +00:00
<EFBFBD>
}<7D><>W<EFBFBD><57><00>@sdZddlZddlZddlmZddlmZmZddlmZm Z
ddlm Z ddl m Z mZdd lmZdd
lmZmZmZmZmZmZmZmZmZmZmZmZGd d <00>d e<00>ZGd d<00>deej<00>ZGdd<00>deej <00>Z!Gdd<00>deej"<00>Z#ie!ej 6eej6e#ej"6Z$iej%d6ejd6ejd6ejd6ejd6ej!d6ej!d6ejd6ejd6ejd6ejd6ejd6ejd6ejd6ejd6ejd 6ejd!6ejd"6ej#d6ej#d#6ejd$6ejd%6ej&d&6ej'd'6Z(Gd(d)<00>d)ej)<00>Z*Gd*d+<00>d+ej+<00>Z,Gd,d-<00>d-ej-<00>Z.Gd.d/<00>d/ej/<00>Z0Gd0d1<00>d1e j1<00>Z2Gd2d3<00>d3e j3<00>Z4dS)4aRD
.. dialect:: sqlite
:name: SQLite
.. _sqlite_datetime:
Date and Time Types
-------------------
SQLite does not have built-in DATE, TIME, or DATETIME types, and pysqlite does
not provide out of the box functionality for translating values between Python
`datetime` objects and a SQLite-supported format. SQLAlchemy's own
:class:`~sqlalchemy.types.DateTime` and related types provide date formatting
and parsing functionality when SQlite is used. The implementation classes are
:class:`~.sqlite.DATETIME`, :class:`~.sqlite.DATE` and :class:`~.sqlite.TIME`.
These types represent dates and times as ISO formatted strings, which also
nicely support ordering. There's no reliance on typical "libc" internals for
these functions so historical dates are fully supported.
Ensuring Text affinity
^^^^^^^^^^^^^^^^^^^^^^
The DDL rendered for these types is the standard ``DATE``, ``TIME``
and ``DATETIME`` indicators. However, custom storage formats can also be
applied to these types. When the
storage format is detected as containing no alpha characters, the DDL for
these types is rendered as ``DATE_CHAR``, ``TIME_CHAR``, and ``DATETIME_CHAR``,
so that the column continues to have textual affinity.
.. seealso::
`Type Affinity <http://www.sqlite.org/datatype3.html#affinity>`_ - in the SQLite documentation
.. _sqlite_autoincrement:
SQLite Auto Incrementing Behavior
----------------------------------
Background on SQLite's autoincrement is at: http://sqlite.org/autoinc.html
Key concepts:
* SQLite has an implicit "auto increment" feature that takes place for any
non-composite primary-key column that is specifically created using
"INTEGER PRIMARY KEY" for the type + primary key.
* SQLite also has an explicit "AUTOINCREMENT" keyword, that is **not**
equivalent to the implicit autoincrement feature; this keyword is not
recommended for general use. SQLAlchemy does not render this keyword
unless a special SQLite-specific directive is used (see below). However,
it still requires that the column's type is named "INTEGER".
Using the AUTOINCREMENT Keyword
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
To specifically render the AUTOINCREMENT keyword on the primary key column
when rendering DDL, add the flag ``sqlite_autoincrement=True`` to the Table
construct::
Table('sometable', metadata,
Column('id', Integer, primary_key=True),
sqlite_autoincrement=True)
Allowing autoincrement behavior SQLAlchemy types other than Integer/INTEGER
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SQLite's typing model is based on naming conventions. Among
other things, this means that any type name which contains the
substring ``"INT"`` will be determined to be of "integer affinity". A
type named ``"BIGINT"``, ``"SPECIAL_INT"`` or even ``"XYZINTQPR"``, will be considered by
SQLite to be of "integer" affinity. However, **the SQLite
autoincrement feature, whether implicitly or explicitly enabled,
requires that the name of the column's type
is exactly the string "INTEGER"**. Therefore, if an
application uses a type like :class:`.BigInteger` for a primary key, on
SQLite this type will need to be rendered as the name ``"INTEGER"`` when
emitting the initial ``CREATE TABLE`` statement in order for the autoincrement
behavior to be available.
One approach to achieve this is to use :class:`.Integer` on SQLite
only using :meth:`.TypeEngine.with_variant`::
table = Table(
"my_table", metadata,
Column("id", BigInteger().with_variant(Integer, "sqlite"), primary_key=True)
)
Another is to use a subclass of :class:`.BigInteger` that overrides its DDL name
to be ``INTEGER`` when compiled against SQLite::
from sqlalchemy import BigInteger
from sqlalchemy.ext.compiler import compiles
class SLBigInteger(BigInteger):
pass
@compiles(SLBigInteger, 'sqlite')
def bi_c(element, compiler, **kw):
return "INTEGER"
@compiles(SLBigInteger)
def bi_c(element, compiler, **kw):
return compiler.visit_BIGINT(element, **kw)
table = Table(
"my_table", metadata,
Column("id", SLBigInteger(), primary_key=True)
)
.. seealso::
:meth:`.TypeEngine.with_variant`
:ref:`sqlalchemy.ext.compiler_toplevel`
`Datatypes In SQLite Version 3 <http://sqlite.org/datatype3.html>`_
.. _sqlite_concurrency:
Database Locking Behavior / Concurrency
---------------------------------------
SQLite is not designed for a high level of write concurrency. The database
itself, being a file, is locked completely during write operations within
transactions, meaning exactly one "connection" (in reality a file handle)
has exclusive access to the database during this period - all other
"connections" will be blocked during this time.
The Python DBAPI specification also calls for a connection model that is
always in a transaction; there is no ``connection.begin()`` method,
only ``connection.commit()`` and ``connection.rollback()``, upon which a
new transaction is to be begun immediately. This may seem to imply
that the SQLite driver would in theory allow only a single filehandle on a
particular database file at any time; however, there are several
factors both within SQlite itself as well as within the pysqlite driver
which loosen this restriction significantly.
However, no matter what locking modes are used, SQLite will still always
lock the database file once a transaction is started and DML (e.g. INSERT,
UPDATE, DELETE) has at least been emitted, and this will block
other transactions at least at the point that they also attempt to emit DML.
By default, the length of time on this block is very short before it times out
with an error.
This behavior becomes more critical when used in conjunction with the
SQLAlchemy ORM. SQLAlchemy's :class:`.Session` object by default runs
within a transaction, and with its autoflush model, may emit DML preceding
any SELECT statement. This may lead to a SQLite database that locks
more quickly than is expected. The locking mode of SQLite and the pysqlite
driver can be manipulated to some degree, however it should be noted that
achieving a high degree of write-concurrency with SQLite is a losing battle.
For more information on SQLite's lack of write concurrency by design, please
see
`Situations Where Another RDBMS May Work Better - High Concurrency
<http://www.sqlite.org/whentouse.html>`_ near the bottom of the page.
The following subsections introduce areas that are impacted by SQLite's
file-based architecture and additionally will usually require workarounds to
work when using the pysqlite driver.
.. _sqlite_isolation_level:
Transaction Isolation Level
----------------------------
SQLite supports "transaction isolation" in a non-standard way, along two
axes. One is that of the `PRAGMA read_uncommitted <http://www.sqlite.org/pragma.html#pragma_read_uncommitted>`_
instruction. This setting can essentially switch SQLite between its
default mode of ``SERIALIZABLE`` isolation, and a "dirty read" isolation
mode normally referred to as ``READ UNCOMMITTED``.
SQLAlchemy ties into this PRAGMA statement using the
:paramref:`.create_engine.isolation_level` parameter of :func:`.create_engine`.
Valid values for this parameter when used with SQLite are ``"SERIALIZABLE"``
and ``"READ UNCOMMITTED"`` corresponding to a value of 0 and 1, respectively.
SQLite defaults to ``SERIALIZABLE``, however its behavior is impacted by
the pysqlite driver's default behavior.
The other axis along which SQLite's transactional locking is impacted is
via the nature of the ``BEGIN`` statement used. The three varieties
are "deferred", "immediate", and "exclusive", as described at
`BEGIN TRANSACTION <http://sqlite.org/lang_transaction.html>`_. A straight
``BEGIN`` statement uses the "deferred" mode, where the the database file is
not locked until the first read or write operation, and read access remains
open to other transactions until the first write operation. But again,
it is critical to note that the pysqlite driver interferes with this behavior
by *not even emitting BEGIN* until the first write operation.
.. warning::
SQLite's transactional scope is impacted by unresolved
issues in the pysqlite driver, which defers BEGIN statements to a greater
degree than is often feasible. See the section :ref:`pysqlite_serializable`
for techniques to work around this behavior.
SAVEPOINT Support
----------------------------
SQLite supports SAVEPOINTs, which only function once a transaction is
begun. SQLAlchemy's SAVEPOINT support is available using the
:meth:`.Connection.begin_nested` method at the Core level, and
:meth:`.Session.begin_nested` at the ORM level. However, SAVEPOINTs
won't work at all with pysqlite unless workarounds are taken.
.. warning::
SQLite's SAVEPOINT feature is impacted by unresolved
issues in the pysqlite driver, which defers BEGIN statements to a greater
degree than is often feasible. See the section :ref:`pysqlite_serializable`
for techniques to work around this behavior.
Transactional DDL
----------------------------
The SQLite database supports transactional :term:`DDL` as well.
In this case, the pysqlite driver is not only failing to start transactions,
it also is ending any existing transction when DDL is detected, so again,
workarounds are required.
.. warning::
SQLite's transactional DDL is impacted by unresolved issues
in the pysqlite driver, which fails to emit BEGIN and additionally
forces a COMMIT to cancel any transaction when DDL is encountered.
See the section :ref:`pysqlite_serializable`
for techniques to work around this behavior.
.. _sqlite_foreign_keys:
Foreign Key Support
-------------------
SQLite supports FOREIGN KEY syntax when emitting CREATE statements for tables,
however by default these constraints have no effect on the operation of the
table.
Constraint checking on SQLite has three prerequisites:
* At least version 3.6.19 of SQLite must be in use
* The SQLite library must be compiled *without* the SQLITE_OMIT_FOREIGN_KEY
or SQLITE_OMIT_TRIGGER symbols enabled.
* The ``PRAGMA foreign_keys = ON`` statement must be emitted on all
connections before use.
SQLAlchemy allows for the ``PRAGMA`` statement to be emitted automatically for
new connections through the usage of events::
from sqlalchemy.engine import Engine
from sqlalchemy import event
@event.listens_for(Engine, "connect")
def set_sqlite_pragma(dbapi_connection, connection_record):
cursor = dbapi_connection.cursor()
cursor.execute("PRAGMA foreign_keys=ON")
cursor.close()
.. warning::
When SQLite foreign keys are enabled, it is **not possible**
to emit CREATE or DROP statements for tables that contain
mutually-dependent foreign key constraints;
to emit the DDL for these tables requires that ALTER TABLE be used to
create or drop these constraints separately, for which SQLite has
no support.
.. seealso::
`SQLite Foreign Key Support <http://www.sqlite.org/foreignkeys.html>`_
- on the SQLite web site.
:ref:`event_toplevel` - SQLAlchemy event API.
:ref:`use_alter` - more information on SQLAlchemy's facilities for handling
mutually-dependent foreign key constraints.
.. _sqlite_type_reflection:
Type Reflection
---------------
SQLite types are unlike those of most other database backends, in that
the string name of the type usually does not correspond to a "type" in a
one-to-one fashion. Instead, SQLite links per-column typing behavior
to one of five so-called "type affinities" based on a string matching
pattern for the type.
SQLAlchemy's reflection process, when inspecting types, uses a simple
lookup table to link the keywords returned to provided SQLAlchemy types.
This lookup table is present within the SQLite dialect as it is for all
other dialects. However, the SQLite dialect has a different "fallback"
routine for when a particular type name is not located in the lookup map;
it instead implements the SQLite "type affinity" scheme located at
http://www.sqlite.org/datatype3.html section 2.1.
The provided typemap will make direct associations from an exact string
name match for the following types:
:class:`~.types.BIGINT`, :class:`~.types.BLOB`,
:class:`~.types.BOOLEAN`, :class:`~.types.BOOLEAN`,
:class:`~.types.CHAR`, :class:`~.types.DATE`,
:class:`~.types.DATETIME`, :class:`~.types.FLOAT`,
:class:`~.types.DECIMAL`, :class:`~.types.FLOAT`,
:class:`~.types.INTEGER`, :class:`~.types.INTEGER`,
:class:`~.types.NUMERIC`, :class:`~.types.REAL`,
:class:`~.types.SMALLINT`, :class:`~.types.TEXT`,
:class:`~.types.TIME`, :class:`~.types.TIMESTAMP`,
:class:`~.types.VARCHAR`, :class:`~.types.NVARCHAR`,
:class:`~.types.NCHAR`
When a type name does not match one of the above types, the "type affinity"
lookup is used instead:
* :class:`~.types.INTEGER` is returned if the type name includes the
string ``INT``
* :class:`~.types.TEXT` is returned if the type name includes the
string ``CHAR``, ``CLOB`` or ``TEXT``
* :class:`~.types.NullType` is returned if the type name includes the
string ``BLOB``
* :class:`~.types.REAL` is returned if the type name includes the string
``REAL``, ``FLOA`` or ``DOUB``.
* Otherwise, the :class:`~.types.NUMERIC` type is used.
.. versionadded:: 0.9.3 Support for SQLite type affinity rules when reflecting
columns.
.. _sqlite_partial_index:
Partial Indexes
---------------
A partial index, e.g. one which uses a WHERE clause, can be specified
with the DDL system using the argument ``sqlite_where``::
tbl = Table('testtbl', m, Column('data', Integer))
idx = Index('test_idx1', tbl.c.data,
sqlite_where=and_(tbl.c.data > 5, tbl.c.data < 10))
The index will be rendered at create time as::
CREATE INDEX test_idx1 ON testtbl (data)
WHERE data > 5 AND data < 10
.. versionadded:: 0.9.9
Dotted Column Names
-------------------
Using table or column names that explicitly have periods in them is
**not recommended**. While this is generally a bad idea for relational
databases in general, as the dot is a syntactically significant character,
the SQLite driver up until version **3.10.0** of SQLite has a bug which
requires that SQLAlchemy filter out these dots in result sets.
.. note::
The following SQLite issue has been resolved as of version 3.10.0
of SQLite. SQLAlchemy as of **1.1** automatically disables its internal
workarounds based on detection of this version.
The bug, entirely outside of SQLAlchemy, can be illustrated thusly::
import sqlite3
conn = sqlite3.connect(":memory:")
cursor = conn.cursor()
cursor.execute("create table x (a integer, b integer)")
cursor.execute("insert into x (a, b) values (1, 1)")
cursor.execute("insert into x (a, b) values (2, 2)")
cursor.execute("select x.a, x.b from x")
assert [c[0] for c in cursor.description] == ['a', 'b']
cursor.execute('''
select x.a, x.b from x where a=1
union
select x.a, x.b from x where a=2
''')
assert [c[0] for c in cursor.description] == ['a', 'b'], \
[c[0] for c in cursor.description]
The second assertion fails::
Traceback (most recent call last):
File "test.py", line 19, in <module>
[c[0] for c in cursor.description]
AssertionError: ['x.a', 'x.b']
Where above, the driver incorrectly reports the names of the columns
including the name of the table, which is entirely inconsistent vs.
when the UNION is not present.
SQLAlchemy relies upon column names being predictable in how they match
to the original statement, so the SQLAlchemy dialect has no choice but
to filter these out::
from sqlalchemy import create_engine
eng = create_engine("sqlite://")
conn = eng.connect()
conn.execute("create table x (a integer, b integer)")
conn.execute("insert into x (a, b) values (1, 1)")
conn.execute("insert into x (a, b) values (2, 2)")
result = conn.execute("select x.a, x.b from x")
assert result.keys() == ["a", "b"]
result = conn.execute('''
select x.a, x.b from x where a=1
union
select x.a, x.b from x where a=2
''')
assert result.keys() == ["a", "b"]
Note that above, even though SQLAlchemy filters out the dots, *both
names are still addressable*::
>>> row = result.first()
>>> row["a"]
1
>>> row["x.a"]
1
>>> row["b"]
1
>>> row["x.b"]
1
Therefore, the workaround applied by SQLAlchemy only impacts
:meth:`.ResultProxy.keys` and :meth:`.RowProxy.keys()` in the public API.
In the very specific case where
an application is forced to use column names that contain dots, and the
functionality of :meth:`.ResultProxy.keys` and :meth:`.RowProxy.keys()`
is required to return these dotted names unmodified, the ``sqlite_raw_colnames``
execution option may be provided, either on a per-:class:`.Connection` basis::
result = conn.execution_options(sqlite_raw_colnames=True).execute('''
select x.a, x.b from x where a=1
union
select x.a, x.b from x where a=2
''')
assert result.keys() == ["x.a", "x.b"]
or on a per-:class:`.Engine` basis::
engine = create_engine("sqlite://", execution_options={"sqlite_raw_colnames": True})
When using the per-:class:`.Engine` execution option, note that
**Core and ORM queries that use UNION may not function properly**.
<EFBFBD>N<>)<01>
processors)<02>sql<71>exc)<02>types<65>schema)<01>util)<02>default<6C>
reflection)<01>compiler) <0C>BLOB<4F>BOOLEAN<41>CHAR<41>DECIMAL<41>FLOAT<41>INTEGER<45>REAL<41>NUMERIC<49>SMALLINT<4E>TEXT<58> TIMESTAMP<4D>VARCHARcsdeZdZdZdZdd<00>fdd<00>Zedd<00><00>Z<00>fdd<00>Zdd <00>Z <00>S)
<EFBFBD>_DateTimeMixinNc sStt|<00>j|<00>|dk r7tj|<00>|_n|dk rO||_ndS)N)<07>superr<00>__init__<5F>re<72>compile<6C>_reg<65>_storage_format)<04>self<6C>storage_format<61>regexp<78>kw)<01> __class__<5F><00>E/tmp/pip-build-zkr322cu/sqlalchemy/sqlalchemy/dialects/sqlite/base.pyr<00>s
  z_DateTimeMixin.__init__cCsT|jidd6dd6dd6dd6dd6dd6dd6}ttjd |<00><00>S)
a`return True if the storage format will automatically imply
a TEXT affinity.
If the storage format contains no non-numeric characters,
it will imply a NUMERIC storage format on SQLite; in this case,
the type will generate its DDL as DATE_CHAR, DATETIME_CHAR,
TIME_CHAR.
.. versionadded:: 1.0.0
r<00>year<61>month<74>day<61>hour<75>minute<74>second<6E> microsecondz[^0-9])r<00>boolr<00>search)r<00>specr$r$r%<00>format_is_text_affinity<74>s z&_DateTimeMixin.format_is_text_affinityc s]t|t<00>rD|jr(|j|d<n|jrD|j|d<qDntt|<00>j||<00>S)Nr r!)<06>
issubclassrrrr<00>adapt)r<00>clsr")r#r$r%r2<00>s   z_DateTimeMixin.adaptcs%|j|<00><00><00>fdd<00>}|S)Ncsd<00>|<00>S)Nz'%s'r$)<01>value)<01>bpr$r%<00>processsz1_DateTimeMixin.literal_processor.<locals>.process)<01>bind_processor)r<00>dialectr6r$)r5r%<00>literal_processorsz _DateTimeMixin.literal_processor)
<EFBFBD>__name__<5F>
__module__<EFBFBD> __qualname__rrr<00>propertyr0r2r9r$r$)r#r%r<00>s rcsFeZdZdZdZ<00>fdd<00>Zdd<00>Zdd<00>Z<00>S) <09>DATETIMEa<45>Represent a Python datetime object in SQLite using a string.
The default string storage format is::
"%(year)04d-%(month)02d-%(day)02d %(hour)02d:%(min)02d:%(second)02d.%(microsecond)06d"
e.g.::
2011-03-15 12:05:57.10558
The storage format can be customized to some degree using the
``storage_format`` and ``regexp`` parameters, such as::
import re
from sqlalchemy.dialects.sqlite import DATETIME
dt = DATETIME(
storage_format="%(year)04d/%(month)02d/%(day)02d %(hour)02d:%(min)02d:%(second)02d",
regexp=r"(\d+)/(\d+)/(\d+) (\d+)-(\d+)-(\d+)"
)
:param storage_format: format string which will be applied to the dict
with keys year, month, day, hour, minute, second, and microsecond.
:param regexp: regular expression which will be applied to incoming result
rows. If the regexp contains named groups, the resulting match dict is
applied to the Python datetime() constructor as keyword arguments.
Otherwise, if positional groups are used, the datetime() constructor
is called with positional arguments via
``*map(int, match_obj.groups(0))``.
zW%(year)04d-%(month)02d-%(day)02d %(hour)02d:%(minute)02d:%(second)02d.%(microsecond)06dcsq|jdd<00>}tt|<00>j||<00>|rmd|ksItd<00><00>d|ksatd<00><00>d|_ndS)N<>truncate_microsecondsFr zDYou can specify only one of truncate_microseconds or storage_format.r!z<You can specify only one of truncate_microseconds or regexp.zE%(year)04d-%(month)02d-%(day)02d %(hour)02d:%(minute)02d:%(second)02d)<06>poprr>r<00>AssertionErrorr)r<00>args<67>kwargsr?)r#r$r%r5s zDATETIME.__init__cs7tj<00>tj<00>|j<00><00><00><00>fdd<00>}|S)Ncs<>|dkrdSt|<00><00>rm<00>i|jd6|jd6|jd6|jd6|jd6|jd6|jd6St|<00><00>r<><00>i|jd6|jd6|jd6dd6dd6dd6dd6Std <00><00>dS)
Nr&r'r(r)r*r+r,rzLSQLite DateTime type only accepts Python datetime and date objects as input.) <09>
isinstancer&r'r(r)r*r+r,<00> TypeError)r4)<03> datetime_date<74>datetime_datetime<6D>formatr$r%r6Gs* 





 


 z(DATETIME.bind_processor.<locals>.process)<03>datetime<6D>dater)rr8r6r$)rFrGrHr%r7Bs
   zDATETIME.bind_processorcCs*|jrtj|jtj<00>StjSdS)N)rr<00>!str_to_datetime_processor_factoryrIZstr_to_datetime)rr8<00>coltyper$r$r%<00>result_processorcs zDATETIME.result_processor)r:r;r<<00>__doc__rrr7rMr$r$)r#r%r> s
! !r>c@s4eZdZdZdZdd<00>Zdd<00>ZdS)<08>DATEaRepresent a Python date object in SQLite using a string.
The default string storage format is::
"%(year)04d-%(month)02d-%(day)02d"
e.g.::
2011-03-15
The storage format can be customized to some degree using the
``storage_format`` and ``regexp`` parameters, such as::
import re
from sqlalchemy.dialects.sqlite import DATE
d = DATE(
storage_format="%(month)02d/%(day)02d/%(year)04d",
regexp=re.compile("(?P<month>\d+)/(?P<day>\d+)/(?P<year>\d+)")
)
:param storage_format: format string which will be applied to the
dict with keys year, month, and day.
:param regexp: regular expression which will be applied to
incoming result rows. If the regexp contains named groups, the
resulting match dict is applied to the Python date() constructor
as keyword arguments. Otherwise, if positional groups are used, the
date() constructor is called with positional arguments via
``*map(int, match_obj.groups(0))``.
z %(year)04d-%(month)02d-%(day)02dcs+tj<00>|j<00><00><00>fdd<00>}|S)NcsU|dkrdSt|<00><00>rE<00>i|jd6|jd6|jd6Std<00><00>dS)Nr&r'r(z;SQLite Date type only accepts Python date objects as input.)rDr&r'r(rE)r4)rFrHr$r%r6<00>s 

 z$DATE.bind_processor.<locals>.process)rIrJr)rr8r6r$)rFrHr%r7<00>s   zDATE.bind_processorcCs*|jrtj|jtj<00>StjSdS)N)rrrKrIrJZ str_to_date)rr8rLr$r$r%rM<00>s zDATE.result_processorN)r:r;r<rNrr7rMr$r$r$r%rOks  rOcsFeZdZdZdZ<00>fdd<00>Zdd<00>Zdd<00>Z<00>S) <09>TIMEa?Represent a Python time object in SQLite using a string.
The default string storage format is::
"%(hour)02d:%(minute)02d:%(second)02d.%(microsecond)06d"
e.g.::
12:05:57.10558
The storage format can be customized to some degree using the
``storage_format`` and ``regexp`` parameters, such as::
import re
from sqlalchemy.dialects.sqlite import TIME
t = TIME(
storage_format="%(hour)02d-%(minute)02d-%(second)02d-%(microsecond)06d",
regexp=re.compile("(\d+)-(\d+)-(\d+)-(?:-(\d+))?")
)
:param storage_format: format string which will be applied to the dict
with keys hour, minute, second, and microsecond.
:param regexp: regular expression which will be applied to incoming result
rows. If the regexp contains named groups, the resulting match dict is
applied to the Python time() constructor as keyword arguments. Otherwise,
if positional groups are used, the time() constructor is called with
positional arguments via ``*map(int, match_obj.groups(0))``.
z6%(hour)02d:%(minute)02d:%(second)02d.%(microsecond)06dcsq|jdd<00>}tt|<00>j||<00>|rmd|ksItd<00><00>d|ksatd<00><00>d|_ndS)Nr?Fr zDYou can specify only one of truncate_microseconds or storage_format.r!z<You can specify only one of truncate_microseconds or regexp.z$%(hour)02d:%(minute)02d:%(second)02d)r@rrPrrAr)rrBrCr?)r#r$r%r<00>s z TIME.__init__cs+tj<00>|j<00><00><00>fdd<00>}|S)Ncs_|dkrdSt|<00><00>rO<00>i|jd6|jd6|jd6|jd6Std<00><00>dS)Nr)r*r+r,z;SQLite Time type only accepts Python time objects as input.)rDr)r*r+r,rE)r4)<02> datetime_timerHr$r%r6<00>s 


 z$TIME.bind_processor.<locals>.process)rI<00>timer)rr8r6r$)rQrHr%r7<00>s   zTIME.bind_processorcCs*|jrtj|jtj<00>StjSdS)N)rrrKrIrRZ str_to_time)rr8rLr$r$r%rM<00>s zTIME.result_processor)r:r;r<rNrrr7rMr$r$)r#r%rP<00>s

rP<00>BIGINTr ZBOOLr r<00> DATE_CHAR<41> DATETIME_CHARZDOUBLErr<00>INTrrrrr<00> TIME_CHARrr<00>NVARCHAR<41>NCHARcs<>eZdZejejji
dd6dd6dd6dd6d d
6d d 6d d6dd6dd6dd6<>Zdd<00>Zdd<00>Z dd<00>Z
dd<00>Z dd<00>Z <00>fdd <00>Z d!d"<00>Zd#d$<00>Zd%d&<00>Z<00>S)'<27>SQLiteCompilerz%mr'z%dr(z%Yr&z%Sr+z%Hr)z%jZdoyz%Mr*z%s<>epochz%wZdowz%W<>weekcKsdS)NZCURRENT_TIMESTAMPr$)r<00>fnr"r$r$r%<00>visit_now_func!szSQLiteCompiler.visit_now_funccKsdS)Nz(DATETIME(CURRENT_TIMESTAMP, "localtime")r$)r<00>funcr"r$r$r%<00>visit_localtimestamp_func$sz(SQLiteCompiler.visit_localtimestamp_funccKsdS)N<>1r$)r<00>exprr"r$r$r%<00>
visit_true'szSQLiteCompiler.visit_truecKsdS)N<>0r$)rrbr"r$r$r%<00> visit_false*szSQLiteCompiler.visit_falsecKsd|j|<00>S)Nzlength%s)Zfunction_argspec)rr]r"r$r$r%<00>visit_char_length_func-sz%SQLiteCompiler.visit_char_length_funcc s<|jjr%tt|<00>j||<00>S|j|j|<00>SdS)N)r8<00> supports_castrrZ<00>
visit_castr6Zclause)r<00>castrC)r#r$r%rh0s zSQLiteCompiler.visit_castc KsZy+d|j|j|j|j|<00>fSWn(tk
rUtjd|j<16><00>YnXdS)Nz#CAST(STRFTIME('%s', %s) AS INTEGER)z#%s is not a valid extract argument.)<07> extract_map<61>fieldr6rb<00>KeyErrorr<00> CompileError)r<00>extractr"r$r$r%<00> visit_extract6s  zSQLiteCompiler.visit_extractcKs<>d}|jdk r5|d|j|j|<00>7}n|jdk r<>|jdkrv|d|jtjd<00><00>7}n|d|j|j|<00>7}n#|d|jtjd<00>|<00>7}|S)N<>z
LIMIT <20>z OFFSET r<00><><EFBFBD><EFBFBD><EFBFBD>)Z _limit_clauser6Z_offset_clauser<00>literal)r<00>selectr"<00>textr$r$r%<00> limit_clause@s # #zSQLiteCompiler.limit_clausecKsdS)Nrpr$)rrtr"r$r$r%<00>for_update_clauseLsz SQLiteCompiler.for_update_clause)r:r;r<rZ update_copyr <00> SQLCompilerrjr^r`rcrerfrhrorvrwr$r$)r#r%rZs,        
rZcs^eZdZdd<00>Z<00>fdd<00>Z<00>fdd<00>Zdd<00>Z<00>fd d
<00>Z<00>S) <0B>SQLiteDDLCompilercKs<>|jjj|jd|<00>}|jj|<00>d|}|j|<00>}|dk rd|d|7}n|jsz|d7}n|jr<>|j j
ddr<>t |j jj <00>dkr<>t |jjtj<00>r<>|j r<>|d7}n|S) NZtype_expression<6F> z DEFAULT z NOT NULL<4C>sqlite<74> autoincrementrqz PRIMARY KEY AUTOINCREMENT)r8<00> type_compilerr6<00>type<70>preparerZ format_columnZget_column_default_string<6E>nullable<6C> primary_key<65>table<6C>dialect_options<6E>len<65>columnsr1<00>_type_affinity<74>sqltypes<65>Integer<65> foreign_keys)r<00>columnrCrLZcolspecr r$r$r%<00>get_column_specificationSs     
 z*SQLiteDDLCompiler.get_column_specificationcs<>t|j<00>dkrkt|<00>d}|jrk|jjddrkt|jjt j
<00>rk|j rkdSnt t |<00>j|<00>S)Nrqrr{r|)r<>r<><00>listr<74>r<>r<>r1r~r<>r<>r<>r<>rry<00>visit_primary_key_constraint)r<00>
constraint<EFBFBD>c)r#r$r%r<>gs 
z.SQLiteDDLCompiler.visit_primary_key_constraintcsV|jdjj}|jdjj}|j|jkr<dStt|<00>j|<00>SdS)Nr)<08>elements<74>parentr<74>r<>rrry<00>visit_foreign_key_constraint)rr<>Z local_tableZ remote_table)r#r$r%r<>vs
z.SQLiteDDLCompiler.visit_foreign_key_constraintcCs|j|dd<00>S)z=Format the remote table clause of a CREATE CONSTRAINT clause.<2E>
use_schemaF)Z format_table)rr<>r<>rr$r$r%<00>define_constraint_remote_table<6C>sz0SQLiteDDLCompiler.define_constraint_remote_tablecsw|j}tt|<00>j|dd<00>}|jdd}|dk rs|jj|dddd<00>}|d|7}n|S) NZinclude_table_schemaFr{<00>whereZ include_tableZ literal_bindsTz WHERE )<07>elementrry<00>visit_create_indexr<78>Z sql_compilerr6)r<00>create<74>indexruZ whereclauseZwhere_compiled)r#r$r%r<><00>s     z$SQLiteDDLCompiler.visit_create_index)r:r;r<r<>r<>r<>r<>r<>r$r$)r#r%ryQs
  rycsReZdZdd<00>Z<00>fdd<00>Z<00>fdd<00>Z<00>fdd<00>Z<00>S) <09>SQLiteTypeCompilercKs |j|<00>S)N)Z
visit_BLOB)r<00>type_r"r$r$r%<00>visit_large_binary<72>sz%SQLiteTypeCompiler.visit_large_binaryc s7t|t<00> s|jr/tt|<00>j|<00>SdSdS)NrU)rDrr0rr<><00>visit_DATETIME)rr<>r")r#r$r%r<><00>s z!SQLiteTypeCompiler.visit_DATETIMEc s7t|t<00> s|jr/tt|<00>j|<00>SdSdS)NrT)rDrr0rr<><00>
visit_DATE)rr<>r")r#r$r%r<><00>s zSQLiteTypeCompiler.visit_DATEc s7t|t<00> s|jr/tt|<00>j|<00>SdSdS)NrW)rDrr0rr<><00>
visit_TIME)rr<>r")r#r$r%r<><00>s zSQLiteTypeCompiler.visit_TIME)r:r;r<r<>r<>r<>r<>r$r$)r#r%r<><00>s  r<>cu@s<>eZdZeddddddddd d
d d d ddddddddddddddddddd 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`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtgt<00>Zdudvdwdx<00>ZdvS)y<>SQLiteIdentifierPreparer<65>add<64>after<65>allZalterZanalyze<7A>and<6E>asZasc<73>attachr|Zbefore<72>beginZbetweenZbyZcascadeZcaseri<00>checkZcollater<65><00>commit<69>conflictr<74>r<>ZcrossZ current_date<74> current_timeZcurrent_timestampZdatabaser Z
deferrable<EFBFBD>deferred<65>delete<74>desc<73>detachZdistinctZdropZeach<63>else<73>end<6E>escape<70>exceptZ exclusiveZexplain<69>falseZfail<69>forZforeign<67>from<6F>full<6C>glob<6F>groupZhaving<6E>if<69>ignoreZ immediate<74>inr<6E>ZindexedZ initially<6C>inner<65>insertZinsteadZ intersectZinto<74>isZisnull<6C>join<69>key<65>leftZlike<6B>limit<69>matchZnatural<61>notZnotnull<6C>nullZof<6F>offset<65>on<6F>or<6F>order<65>outerZplan<61>pragmaZprimary<72>query<72>raiseZ
referencesZreindex<65>rename<6D>replaceZrestrict<63>right<68>rollback<63>rowrt<00>setr<74><00>temp<6D> temporaryZthen<65>toZ transactionZtrigger<65>true<75>union<6F>unique<75>updateZusingZvacuum<75>valuesZviewZvirtual<61>whenr<6E>TNcCs|dkr|j}n|j||j<00>}|j r{|r{t|jdd<00>r{|j|jj|jj<00>d|}n|S)z'Prepare a quoted index and schema name.Nr<00>.)<07>name<6D>quoteZ omit_schema<6D>getattrr<72>Z quote_schemar)rr<>r<>r<><00>resultr$r$r%<00> format_index<65>s  
)z%SQLiteIdentifierPreparer.format_index)r:r;r<r<>Zreserved_wordsr<73>r$r$r$r%r<><00>s(  r<>c@s1eZdZejdd<00><00>Zdd<00>ZdS)<06>SQLiteExecutionContextcCs|jjdd<00>S)NZsqlite_raw_colnamesF)Zexecution_options<6E>get)rr$r$r%<00>_preserve_raw_colnames<65>sz-SQLiteExecutionContext._preserve_raw_colnamescCs;|j r-d|kr-|jd<00>d|fS|dfSdS)Nr<4E>rqrr)r<><00>split)rZcolnamer$r$r%<00>_translate_colname<6D>sz)SQLiteExecutionContext._translate_colnameN)r:r;r<rZmemoized_propertyr<79>r<>r$r$r$r%r<><00>s r<>c@sHeZdZdZdZdZdZdZdZdZ dZ
dZ dZ e ZeZeZeZeZeZeZdZdZ dZejidd6fejidd6fgZdZdddd <00>Zid
d 6d d 6Z dd<00>Z!dd<00>Z"dd<00>Z#e$j%ddd<00><00>Z&e$j%dd<00><00>Z'e$j%dd<00><00>Z(ddd<00>Z)e$j%ddd<00><00>Z*e$j%ddd<00><00>Z+e$j%dd d!<00><00>Z,d"d#<00>Z-d$d%<00>Z.e$j%dd&d'<00><00>Z/e$j%dd(d)<00><00>Z0d*d+<00>Z1e$j%dd,d-<00><00>Z2e$j%dd.d/<00><00>Z3e$j%dd0d1<00><00>Z4dd2d3<00>Z5dS)4<> SQLiteDialectr{FTZqmarkNr|r<>cKs<>tjj||<00>||_||_|jdk r<>|jjdk|_|jjd k|_|jjd
k|_ |jjd k|_
ndS) Nr<00><00><00><00> <00><00>)rrr<>)rr<>r)rr<>r<>)rr<>r<>) r <00>DefaultDialectr<00>isolation_level<65>native_datetimeZdbapiZsqlite_version_info<66>supports_default_valuesrg<00>supports_multivalues_insert<72>_broken_fk_pragma_quotes)rr<>r<>rCr$r$r%rs  zSQLiteDialect.__init__rqzREAD UNCOMMITTEDr<00> SERIALIZABLEc Cs<>y|j|jdd<00>}Wn=tk
r\tjd||jdj|j<00>f<16><00>YnX|j<00>}|jd|<16>|j <00>dS)N<>_rzzLInvalid value '%s' for isolation_level. Valid isolation levels for %s are %sz, zPRAGMA read_uncommitted = %d)
<EFBFBD>_isolation_lookupr<70>rlr<00> ArgumentErrorr<72>r<><00>cursor<6F>execute<74>close)r<00>
connection<EFBFBD>levelr<6C>r<>r$r$r%<00>set_isolation_level*s ' z!SQLiteDialect.set_isolation_levelcCs<>|j<00>}|jd<00>|j<00>}|r8|d}nd}|j<00>|dkrXdS|dkrhdSds~td|<16><00>dS)NzPRAGMA read_uncommittedrr<>rqzREAD UNCOMMITTEDFzUnknown isolation level %s)r<>r<>Zfetchoner<65>rA)rr<>r<><00>resr4r$r$r%<00>get_isolation_level7s    
  z!SQLiteDialect.get_isolation_levelcs-<00>jdk r%<00>fdd<00>}|SdSdS)Ncs<00>j|<00>j<00>dS)N)r<>r<>)<01>conn)rr$r%<00>connectOsz)SQLiteDialect.on_connect.<locals>.connect)r<>)rrr$)rr%<00>
on_connectMszSQLiteDialect.on_connectcKs^|dk r+|jj|<00>}d|}nd}d|f}|j|<00>}dd<00>|D<>S)Nz%s.sqlite_master<65> sqlite_masterz4SELECT name FROM %s WHERE type='table' ORDER BY namecSsg|]}|d<19>qS)rr$)<02>.0r<EFBFBD>r$r$r%<00>
<listcomp>_s z1SQLiteDialect.get_table_names.<locals>.<listcomp>)<03>identifier_preparer<65>quote_identifierr<72>)rr<>rr"<00>qschema<6D>master<65>s<>rsr$r$r%<00>get_table_namesUs  
zSQLiteDialect.get_table_namescKs&d}|j|<00>}dd<00>|D<>S)NzESELECT name FROM sqlite_temp_master WHERE type='table' ORDER BY name cSsg|]}|d<19>qS)rr$)rr<>r$r$r%rgs z6SQLiteDialect.get_temp_table_names.<locals>.<listcomp>)r<>)rr<>r"r r r$r$r%<00>get_temp_table_namesasz"SQLiteDialect.get_temp_table_namescKs&d}|j|<00>}dd<00>|D<>S)NzDSELECT name FROM sqlite_temp_master WHERE type='view' ORDER BY name cSsg|]}|d<19>qS)rr$)rr<>r$r$r%ros z5SQLiteDialect.get_temp_view_names.<locals>.<listcomp>)r<>)rr<>r"r r r$r$r%<00>get_temp_view_namesisz!SQLiteDialect.get_temp_view_namescCs%|j|d|d|<00>}t|<00>S)N<>
table_infor)<02>_get_table_pragmar-)rr<><00>
table_namer<00>infor$r$r%<00> has_tableqszSQLiteDialect.has_tablecKs^|dk r+|jj|<00>}d|}nd}d|f}|j|<00>}dd<00>|D<>S)Nz%s.sqlite_masterrz3SELECT name FROM %s WHERE type='view' ORDER BY namecSsg|]}|d<19>qS)rr$)rr<>r$r$r%r<00>s z0SQLiteDialect.get_view_names.<locals>.<listcomp>)rr r<>)rr<>rr"r
r r r r$r$r%<00>get_view_namesvs  
zSQLiteDialect.get_view_namesc
Ks<>|dk rJ|jj|<00>}d|}d||f}|j|<00>}nNyd|}|j|<00>}Wn.tjk
r<>d|}|j|<00>}YnX|j<00>} | r<>| djSdS)Nz%s.sqlite_masterz3SELECT sql FROM %s WHERE name = '%s'AND type='view'z}SELECT sql FROM (SELECT * FROM sqlite_master UNION ALL SELECT * FROM sqlite_temp_master) WHERE name = '%s' AND type='view'z?SELECT sql FROM sqlite_master WHERE name = '%s' AND type='view'r)rr r<>r<00>
DBAPIError<EFBFBD>fetchallr)
rr<>Z view_namerr"r
r r r r<>r$r$r%<00>get_view_definition<6F>s" 
  z!SQLiteDialect.get_view_definitionc Ks<>|j|d|d|<00>}g}xo|D]g}|d|dj<00>|d |d|df\}} }
} } |j|j|| |
| | <00><00>q(W|S)Nrrrqr<>r<00><00>)r<00>upper<65>append<6E>_get_column_info) rr<>rrr"rr<>r<>r<>r<>r<>r r<>r$r$r%<00> get_columns<6E>s ?zSQLiteDialect.get_columnscCsa|j|<00>}|dk r-tj|<00>}ni|d6|d6|d6|d6|dkd6|d6S)Nr<4E>r~r<>r r|r<>)<03>_resolve_type_affinityr<00> text_type)rr<>r<>r<>r r<>rLr$r$r%r<00>s  zSQLiteDialect._get_column_infoc Cs<>tjd|<00>}|r9|jd<00>}|jd<00>}n d}d}||jkrd|j|}n<>d|kr|tj}n<>d|ks<>d|ks<>d|kr<>tj}nXd |ks<>| r<>tj}n9d
|ks<>d |ks<>d |kr<>tj}n tj }|d k rwtj
d|<00>}y|dd<00>|D<><00>}Wq<57>t k
rst j d||f<16>|<00>}Yq<59>Xn |<00>}|S)aZReturn a data type from a reflected column, using affinity tules.
SQLite's goal for universal compatibility introduces some complexity
during reflection, as a column's defined type might not actually be a
type that SQLite understands - or indeed, my not be defined *at all*.
Internally, SQLite handles this with a 'data type affinity' for each
column definition, mapping to one of 'TEXT', 'NUMERIC', 'INTEGER',
'REAL', or 'NONE' (raw bits). The algorithm that determines this is
listed in http://www.sqlite.org/datatype3.html section 2.1.
This method allows SQLAlchemy to support that algorithm, while still
providing access to smarter reflection utilities by regcognizing
column definitions that SQLite only supports through affinity (like
DATE and DOUBLE).
z([\w ]+)(\(.*?\))?rqr<>rprVrZCLOBrr rZFLOAZDOUBNz(\d+)cSsg|]}t|<00><00>qSr$)<01>int)r<00>ar$r$r%r<00>s z8SQLiteDialect._resolve_type_affinity.<locals>.<listcomp>zNCould not instantiate type %s with reflected arguments %s; using no arguments.)rr<>r<><00> ischema_namesr<73>rrZNullTyperr<00>findallrEr<00>warn)rr<>r<>rLrBr$r$r%r <00>s8  $  $     z$SQLiteDialect._resolve_type_affinitycKs_|j||||<00>}g}x,|D]$}|dr%|j|d<19>q%q%Wi|d6dd6S)Nr<4E>r<><00>constrained_columns)rr)rr<>rrr"<00>colsZpkeys<79>colr$r$r%<00>get_pk_constraint<6E>s  
zSQLiteDialect.get_pk_constraintc s<00>j|d|d|<00>}i}x<>|D]<5D>}|d|d|d|df\}} }
} | dkrq|
} n<00>jr<>tjdd| <00>} n||kr<>||} n;idd 6gd
6dd 6| d 6gd 6} ||<| ||<| d
j|
<00>| d j| <00>q(Wdd<00><00>t<00>fdd<00>|j<00>D<><00>} <00>j||d|<00><01><00>dkregS<><00>fdd<00>}g}x~|<00>D]s\}}}}<00>|||<00>}|| kr<>tj d||f<16>q<>n| j
|<00>}||d <|j|<00>q<>W|j | j<00><00>|S)NZforeign_key_listrrr<>rrz^[\"\[`\']|[\"\]`\']$rpr<>r'Zreferred_schema<6D>referred_table<6C>referred_columnscSst|<00>|ft|<00>S)N)<01>tuple)r'r+r,r$r$r%<00>fk_sigsz.SQLiteDialect.get_foreign_keys.<locals>.fk_sigc3s3|])}<00>|d|d|d<19>|fVqdS)r'r+r,Nr$)r<00>fk)r.r$r%<00> <genexpr>$sz1SQLiteDialect.get_foreign_keys.<locals>.<genexpr>c3s<>d}x<>tj|<00>tj<00>D]<5D>}|jddddd<00>\}}}}}t<00>j|<00><00>}|ss|}nt<00>j|<00><00>}|p<>|}||||fVqWdS)Nzf(?:CONSTRAINT (\w+) +)?FOREIGN KEY *\( *(.+?) *\) +REFERENCES +(?:(?:"(.+?)")|([a-z0-9_]+)) *\((.+?)\)rqr<>rrr)r<00>finditer<65>Ir<49>r<><00>_find_cols_in_sig)Z
FK_PATTERNr<EFBFBD><00>constraint_namer'Zreferred_quoted_name<6D> referred_namer,)r<00>
table_datar$r%<00> parse_fks1s*  z1SQLiteDialect.get_foreign_keys.<locals>.parse_fkszhWARNING: SQL-parsed foreign key constraint '%s' could not be located in PRAGMA foreign_keys for table %s) rr<>r<00>subr<00>dictr<74><00>_get_table_sqlrr&r@<00>extend)rr<>rrr"Z
pragma_fksZfksr<73>Z numerical_idZrtblZlcolZrcolr/Zkeys_by_signaturer7Zfkeysr4r'r5r,<00>sigr<67>r$)r.rr6r%<00>get_foreign_keys<79>sZ .     
    
zSQLiteDialect.get_foreign_keysccsDx=tjd|tj<00>D]#}|jd<00>p:|jd<00>VqWdS)Nz(?:"(.+?)")|([a-z0-9_]+)rqr<>)rr1r2r<>)rr<r<>r$r$r%r3aszSQLiteDialect._find_cols_in_sigc  s i}x\<00>j||d|dd|<00>D]9}|djd<00>sGq(nt|d<19>}|||<q(W<>j||d||<00><01><00>s<>gSg}<00><00>fdd<00>} x`| <00>D]U\}
} t| <00>}||kr<>|j|<00>i|
d6| d6} |j| <00>q<>q<>W|S) Nr<00>include_auto_indexesTr<54><00>sqlite_autoindex<65> column_namesc3s<>d}d}xRtj|<00>tj<00>D]8}|jdd<00>\}}|t<00>j|<00><00>fVq%WxXtj|<00>tj<00>D]>}t<00>j|jd<00>p<>|jd<00><00><00>}d|fVqzWdS)Nz,(?:CONSTRAINT "?(.+?)"? +)?UNIQUE *\((.+?)\)z-(?:(".+?")|([a-z0-9]+)) +[a-z0-9_ ]+? +UNIQUErqr<>)rr1r2r<>r<>r3)ZUNIQUE_PATTERNZINLINE_UNIQUE_PATTERNr<4E>r<>r()rr6r$r%<00> parse_uqsys*z7SQLiteDialect.get_unique_constraints.<locals>.parse_uqs)<06> get_indexes<65>
startswithr-r:r@r) rr<>rrr"Zauto_index_by_sig<69>idxr<Zunique_constraintsrAr<>r(Zparsed_constraintr$)rr6r%<00>get_unique_constraintses.    
z$SQLiteDialect.get_unique_constraintsc
Ks<>|j|d|d|<00>}g}|jdd<00>}xX|D]P}| r`|djd<00>r`q:n|jtd|ddgd |d
<19><03>q:WxM|D]E} |j|d | d<19>}
x#|
D]}| dj|d
<19>q<>Wq<57>W|S) NZ
index_listrr>Frqr?r<>r@r<>r<>Z
index_info)rr@rCrr9) rr<>rrr"Zpragma_indexes<65>indexesr>r<>rDZ pragma_indexr$r$r%rB<00>s .  zSQLiteDialect.get_indexesc KsXyd|}|j|<00>}Wn.tjk
rMd|}|j|<00>}YnX|j<00>S)Nz<4E>SELECT sql FROM (SELECT * FROM sqlite_master UNION ALL SELECT * FROM sqlite_temp_master) WHERE name = '%s' AND type = 'table'zBSELECT sql FROM sqlite_master WHERE name = '%s' AND type = 'table')r<>rrZscalar)rr<>rrr"r r r$r$r%r:<00>szSQLiteDialect._get_table_sqlc
Cs<>|jj}|dk r+d||<00>}nd}||<00>}d|||f}|j|<00>}|jsw|j<00>} ng} | S)Nz
PRAGMA %s.zPRAGMA z%s%s(%s))rr r<>Z _soft_closedr)
rr<>r<>rrr<>Z statementZqtabler<65>r<>r$r$r%r<00>s    zSQLiteDialect._get_table_pragma)6r:r;r<r<>Zsupports_alterZsupports_unicode_statementsZsupports_unicode_bindsr<73>Zsupports_empty_insertrgr<>Zsupports_right_nested_joinsZdefault_paramstyler<65>Zexecution_ctx_clsrZZstatement_compilerryZ ddl_compilerr<72>r}r<>rr$<00>colspecsr<73><00> sa_schemaZTable<6C>IndexZconstruct_argumentsr<73>rr<>r<>rrr
<00>cacherrrrrrrrr r*r=r3rErBr:rr$r$r$r%r<><00>sr  
 
      5i 1r<>)5rNrIrrprrrrr<>rrHrZenginer r
r r r rrrrrrrrrr<00>objectr<00>DateTimer>ZDaterOZTimerPrGrSrXrYr$rxrZZ DDLCompilerryZGenericTypeCompilerr<72>ZIdentifierPreparerr<72>ZDefaultExecutionContextr<74>r<>r<>r$r$r$r%<00><module><3E>s`  R.^=G

 






















 @F$