"""
Support for the Firebird database.
-Connectivity is usually supplied via the kinterbasdb_
-DBAPI module.
+Connectivity is usually supplied via the kinterbasdb_ DBAPI module.
-Firebird dialects
------------------
+Dialects
+~~~~~~~~
Firebird offers two distinct dialects_ (not to be confused with a
SQLAlchemy ``Dialect``):
support for dialect 1 is not well tested and probably has
incompatibilities.
-Firebird Locking Behavior
--------------------------
+Locking Behavior
+~~~~~~~~~~~~~~~~
Firebird locks tables aggressively. For this reason, a DROP TABLE may
hang until other transactions are released. SQLAlchemy does its best
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.
firebird_returning=[empl.c.id, empl.c.salary]).execute().fetchall()
-.. [#] Well, that is not the whole story, as the client may still ask
- a different (lower) dialect...
-
.. _dialects: http://mc-computing.com/Databases/Firebird/SQL_Dialect.html
-.. _kinterbasdb: http://sourceforge.net/projects/kinterbasdb
"""
+# kinterbasdb.py
+# Copyright (C) 2005, 2006, 2007, 2008, 2009 Michael Bayer mike_mp@zzzcomputing.com
+#
+# This module is part of SQLAlchemy and is released under
+# the MIT License: http://www.opensource.org/licenses/mit-license.php
+
+"""
+The most common way to connect to a Firebird engine is implemented by
+kinterbasdb__, currently maintained__ directly by the Firebird people.
+
+The connection URL is of the form
+``firebird[+kinterbasdb]://user:password@host:port/path/to/db[?key=value&key=value...]``.
+
+Kinterbasedb backend specific keyword arguments are:
+
+type_conv
+ select the kind of mapping done on the types: by default SQLAlchemy
+ uses 200 with Unicode, datetime and decimal support (see details__).
+
+concurrency_level
+ set the backend policy with regards to threading issues: by default
+ SQLAlchemy uses policy 1 (see details__).
+
+__ http://sourceforge.net/projects/kinterbasdb
+__ http://firebirdsql.org/index.php?op=devel&sub=python
+__ http://kinterbasdb.sourceforge.net/dist_docs/usage.html#adv_param_conv_dynamic_type_translation
+__ http://kinterbasdb.sourceforge.net/dist_docs/usage.html#special_issue_concurrency
+"""
+
from sqlalchemy.dialects.firebird.base import FBDialect, FBCompiler
from sqlalchemy.engine.default import DefaultExecutionContext