Yes, that's the idea: an alternative. Something like:<br><code><br>try:<br> import theDriverUsuallyUsed as db<br> dbDriver = 'tDUU'<br>except ImportError:<br> import adodbapi as db<br> dbDriver = 'ado'<br>
</code><br><br>If there are differences that show up later in the code, they would be handled by<br>something like:<br><code><br>if dbDriver == 'tDUU':<br> conn = db.connect("the traditional connection string")<br>
else:<br> conn = db.connect("the ADO connection string")<br></code><br><br>IronPython makes a very good transitional step because it uses Python 2 syntax, but makes the jump to strings being Unicode. [There was a small problem with the way Microsoft was handling "string1 = str(string2)", but I believe that is fixed for the 2.7A1 release.] Adodbapi uses "if sys.platform == 'clr':" to handle the differences between Iron and C. The source is then run through 2to3 to correct to syntax changes, and uses "if sys.version[0] >= '3':" for the remaining idiosyncrasies. If differences are pervasive, a function or method is defined to handle it. Same source code, TEN versions of Python. (C 2.3, 2.4, 2.5, 2.6, 2.7, Iron 2.0,2.6,2.7, Python 3.0,3.1) It is not really too hard. The application programmer sees no difference between the versions.<br>
<br>Proposed matrix for Storm platform growth:<br>
(OS) -> (Python version) -> (dbDriver) = (status)<br>
Linux -> Cpython -> traditional drivers = Works!<br>
Windows -> CPython -> traditional drivers = Works!<br>
Windows -> CPython -> adodbapi = proposed step 1<br>Windows(add MS SQL support) -> CPython -> adodbapi = proposed step 2<br>
Windows -> IronPython -> adodbapi = proposed step 3<br>
Linux(add MS SQL support) -> IronPython -> adodbapi = proposed step 4<br>
Windows -> Python 3 -> adodbapi = proposed step 5<br>
Windows -> Python 3 -> traditional drivers = automatic when drivers become available.<br>
Linux -> Python 3 -> traditional drivers = automatic when drivers become available.<br><br>Whaddya think?<br>--<br>Vernon<br><br><div class="gmail_quote">On Wed, Jul 28, 2010 at 10:36 AM, Jamu Kakar <span dir="ltr"><<a href="mailto:jkakar@kakar.ca">jkakar@kakar.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi,<br>
<div class="im"><br>
On Wed, Jul 28, 2010 at 4:49 PM, Vernon Cole <<a href="mailto:vernondcole@gmail.com">vernondcole@gmail.com</a>> wrote:<br>
> So, if I offer patches to use adodbapi for the now-supported database<br>
> engines (as an option to than the "native" dbapi for each one) would those<br>
> patches be considered?<br>
><br>
> The advantages:<br>
> 1) Microsoft SQL Server databases could also be supported.<br>
> 2) No need to install/import multiple api packages in order to read multiple<br>
> db engines.<br>
> 3) Storm could be ported to Python 3.<br>
> 4) Storm could be ported to IronPython.<br>
><br>
> The disadvantages:<br>
> 1) The code for each engine's front end would be a bit more complex (need to<br>
> try adodbapi if the preferred import fails.)<br>
> 2) Adodbapi does not work on Linux -- yet.<br>
><br>
> Followup question:<br>
> If I make adodbapi run on Linux (would require IronPython and Mono) would<br>
> you be more likely to accept the patches?<br>
<br>
</div>I think we'd consider adopting adodbabi as an alternative, but not<br>
as a replacement for the existing native drivers. Storm not running<br>
on linux with CPython is a blocker, as far as I'm concerned.<br>
<br>
Thanks,<br>
<font color="#888888">J.<br>
</font></blockquote></div><br>