# firebird/fdb.py# Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file>## This module is part of SQLAlchemy and is released under# the MIT License: http://www.opensource.org/licenses/mit-license.php""".. dialect:: firebird+fdb :name: fdb :dbapi: pyodbc :connectstring: firebird+fdb://user:password@host:port/path/to/db[?key=value&key=value...] :url: http://pypi.python.org/pypi/fdb/ fdb is a kinterbasdb compatible DBAPI for Firebird. .. versionadded:: 0.8 - Support for the fdb Firebird driver.Status------The fdb dialect is new and not yet tested (can't get fdb to build)."""from.kinterbasdbimportFBDialect_kinterbasdbfrom...importutilclassFBDialect_fdb(FBDialect_kinterbasdb):@classmethoddefdbapi(cls):return__import__('fdb')defcreate_connect_args(self,url):opts=url.translate_connect_args(username='user')ifopts.get('port'):opts['host']="%s/%s"%(opts['host'],opts['port'])delopts['port']opts.update(url.query)util.coerce_kw_type(opts,'type_conv',int)return([],opts)def_get_server_version_info(self,connection):"""Get the version of the Firebird server used by a connection. Returns a tuple of (`major`, `minor`, `build`), three integers representing the version of the attached server. """# This is the simpler approach (the other uses the services api),# that for backward compatibility reasons returns a string like# LI-V6.3.3.12981 Firebird 2.0# where the first version is a fake one resembling the old# Interbase signature.isc_info_firebird_version=103fbconn=connection.connectionversion=fbconn.db_info(isc_info_firebird_version)returnself._parse_version_info(version)dialect=FBDialect_fdb