Database dialect misdetected

Issue #2920 wontfix
Former user created an issue

Currently SQLAlchemy detects the the SQL dialect of a database based on the version string of the DBMS. Newer DBMS can manage databases with older SQL dialects. Firebird can manage an older InterBase databases with SQL dialect 1 for example. In one of my assigned projects we have database with SQL dialect 1 and clients which depend upon this, but I can't execute DDL statements on the database because SQLAlchemy detects the dialect as 2 based on the Firebird version number. One can determine the SQL dialect of a database with isc_database_info and its respective Python wrappers more reliably. I can provide a patch that corrects the detection mechanism, if it gets accepted upstream.

Comments (3)

  1. Mike Bayer repo owner

    OK, the "dialect" is based on server_version_info being "interbase" or "firebird" and that version itself is based on "fbconn.db_info(isc_info_firebird_version)". If isc_database_info is more specific, then that should be used. However if the isc_database_info feature is not available on older versions (which I'm assuming is the case), the function shouldn't crash and should fall back to the old behavior.

    please send a pull request.

  2. Log in to comment