Designing DBI compliant SQL parameters for module

Israel Brewster israel at ravnalaska.net
Mon Nov 23 13:29:28 EST 2015


My company uses a database (4th dimension) for which there was no python DBI compliant driver available (I had to use ODBC, which I felt was cludgy). However, I did discover that the company had a C driver available, so I went ahead and used CFFI to wrap this driver into a DBI compliant python module (https://pypi.python.org/pypi/p4d). This works well (still need to make it python 3.x compatible), but since the underlying C library uses "qmark" style parameter markers, that's all I implemented in my module.

I would like to expand the module to be able to use the more-common (or at least easier for me) "format" and "pyformat" parameter markers, as indicated in the footnote to PEP-249 (https://www.python.org/dev/peps/pep-0249/#id2 at least for the pyformat markers). Now I am fairly confidant that I can write code to convert such placeholders into the qmark style markers that the underlying library provides, but before I go and re-invent the wheel, is there already code that does this which I can simply use, or modify?
-----------------------------------------------
Israel Brewster
Systems Analyst II
Ravn Alaska
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7293
-----------------------------------------------







More information about the Python-list mailing list