Firebird Driver with UTF8

Issue #1779 resolved
Former user created an issue

Hi,

firebird requires an type_conv value to store utf8 strings in text blobs. This value is required to be an integer value. When configuring an connection string the type_conv value is passed as a string - not an integer.

In SQL Alchemy 0.6.0 within sqlalchemy/dialects/firebird/kinterbasdb.py casting type_conv to int works:

-- sqlalchemy/dialects/firebird/kinterbasdb.py --
113  if not initialized:
114      self.dbapi.init(type_conv=int(type_conv), concurrency_level=concurrency_level)
-- sip --

Thanks,

Christian

Comments (6)

  1. Lele Gaifax

    Are you passing your own type_conv? Because I don't see how it could be a string: the default value is 200, and the code path thru the line you mention does not seem altering it in any way...

    Oh, maybe you are passing it within the connection URL? If so, I'd rather coerce it to int at __init__() time.

  2. Former user Account Deleted

    Yes - i've configured it within the connection string:

    firebird://sysdba:masterkey@127.0.0.1:3050//database/test.fdb?type_conv=300

    When I added it in the init function directly I got another error (something with date time values directly in kinterbasdb).

  3. Mike Bayer repo owner
    • changed milestone to 0.6.1

    the appropriate place to coerce a url-derived string into int is in create_connect_args. util.coerce_kw_type(opts, 'type_conv', int) before we "pop" it is best. since that's where we deal with converting from a URL to proper configuration parameters.

  4. Log in to comment