Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #99278 > unrolled thread

Designing DBI compliant SQL parameters for module

Started byIsrael Brewster <israel@ravnalaska.net>
First post2015-11-23 09:29 -0900
Last post2015-11-23 09:29 -0900
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  Designing DBI compliant SQL parameters for module Israel Brewster <israel@ravnalaska.net> - 2015-11-23 09:29 -0900

#99278 — Designing DBI compliant SQL parameters for module

FromIsrael Brewster <israel@ravnalaska.net>
Date2015-11-23 09:29 -0900
SubjectDesigning DBI compliant SQL parameters for module
Message-ID<mailman.72.1448303374.2291.python-list@python.org>
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
-----------------------------------------------



[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web