Firebird Driver with UTF8
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)
-
-
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).
-
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. -
repo owner - changed status to resolved
-
Account Deleted Reading this issue, just notice that the docs page (http://www.sqlalchemy.org/docs/reference/dialects/firebird.html#kinterbasdb) references the old and unmaintained kinterbasedb docs from sourceforge (not containing the latest info about type_conv=300) instead of http://firebirdsql.org/devel/python/docs/3.3.0/index.html
Fix that links too please. Thx.
-
repo owner - removed milestone
Removing milestone: 0.6.1 (automated comment)
- Log in to comment
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.