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


Groups > comp.lang.python > #99278

Designing DBI compliant SQL parameters for module

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Israel Brewster <israel@ravnalaska.net>
Newsgroups comp.lang.python
Subject Designing DBI compliant SQL parameters for module
Date Mon, 23 Nov 2015 09:29:28 -0900
Lines 29
Message-ID <mailman.72.1448303374.2291.python-list@python.org> (permalink)
Mime-Version 1.0 (Mac OS X Mail 9.1 \(3096.5\))
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding quoted-printable
X-Trace news.uni-berlin.de xO0Yi/tBRUCf5kMFS4yNpwoTYAXy9RZKwgth0lWgNRbA==
Return-Path <israel@ravnalaska.net>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.014
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'url:pypi': 0.03; 'indicated': 0.07; 'subject:module': 0.09; 'underlying': 0.09; 'python': 0.10; 'helvetica;': 0.15; 'break-word;': 0.16; 'footnote': 0.16; 'markers,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'space;': 0.16; 'subject:parameters': 0.16; 'word-wrap:': 0.16; 'driver': 0.18; 'library': 0.20; 'fairly': 0.22; '3.x': 0.22; 'parameter': 0.22; '(or': 0.23; 'implemented': 0.24; 'skip:- 40': 0.25; 'module': 0.25; 'least': 0.27; '12px;': 0.27; 'module.': 0.27; 'tech': 0.27; 'went': 0.28; 'flying': 0.29; 'url:peps': 0.29; 'convert': 0.29; 'code': 0.30; 'to:name:python-list': 0.30; 'url:python': 0.33; 'wrap': 0.33; 'skip:- 10': 0.34; '0);': 0.34; 'ahead': 0.35; 'url:dev': 0.35; 'but': 0.36; 'there': 0.36; 'url:org': 0.36; 'to:addr:python- list': 0.36; 'received:10': 0.37; 'charset:us-ascii': 0.37; 'skip:- 20': 0.39; 'does': 0.39; 'to:addr:python.org': 0.40; 'company': 0.60; 'header:Message-Id:1': 0.61; 'compliant': 0.66; 'received:10.9': 0.66; 'discover': 0.73; 'received:12': 0.81; 'skip:4 60': 0.84; 'subject:SQL': 0.84; '0px;">': 0.91; 'alaska': 0.91; 'start;': 0.91
X-Warning RFC compliance checks disabled due to whitelist
X-Warning Reverse-Path DNS check skipped due to whitelist
X-Warning Maximum message size check skipped due to whitelist
X-Warning Realtime Block Lists skipped due to whitelist
X-Warning System filters skipped due to whitelist
X-Warning Domain filters skipped due to whitelist
X-Warning User filters skipped due to whitelist
X-Warning Anti-Spam check skipped due to whitelist
X-Whitelist 2147483645
X-Envelope-From israel@ravnalaska.net
X-Envelope-To python-list@python.org
X-Mailer Apple Mail (2.3096.5)
X-Content-Filtered-By Mailman/MimeDel 2.1.20+
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:99278

Show key headers only | View raw


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
-----------------------------------------------



Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web