[DB-SIG] Insert for Oracledb

M.-A. Lemburg lemburg@uni-duesseldorf.de
Mon, 24 Nov 1997 23:53:26 +0100


Christian Tismer wrote:
> 
> I'm a bit concerned about all these c modules necessary. I'd keep
> them to a minimum, to do the hard work. Everything else would be
> much easier to test and configure if it could go into Python code.

There's a problem with this approach: you often need to allocate
buffer

> 
> Sam Rushing did something with his calldll module. This goes too
> far into the opposite direction. A set of kernel functions would be
> right to code in c. It should use less lines than DBI and ODBC and
> mxODBC, expose what's necessary for the structures, but allow for
> some sophisticated Python code to deal with special cases.
> 
> If I had to adapt to another ODBC driver, I'd like to do it from
> Python, try it out with the pywin browser, all of that.

Ideally you would only have to poke around the ODBC interface
a bit: not every "ODBC driver" does really conform to the
standard. E.g. take the SQLTables() API: Adabas doesn't return
any qualifier (it's always NULL) and does some rather nasty
truncations too... those are things you can't change no matter
whether you're using Python or C. You're always better off
having a database abstraction layer in your apps. That can be
done in Python and so is easy to adjust to new environments.

> Does it make sense to expose the ODBC API partially, provide a row
> of basic finctions and buld upon it from Python?

Hmm, the DB API is already pretty lean. I guess you always need
some 1500 lines of C code to get a reasonably working interface.

I'm currently working on the catalog functions:
	SQLColumnPrivileges 
	SQLColumns 
	SQLForeignKeys 
	SQLPrimaryKeys 
	SQLProcedureColumns 
	SQLProcedures 
	SQLSpecialColumns 
	SQLStatistics 
	SQLTablePrivileges 
	SQLTables 

Most of them will be in Version 0.3 of mxODBC. (I also fixed
a bug that caused a segfault when reusing a cursor with a
larger output column set than the first .execute.) Should be out
by the end of the week. BTW: I'd really like to make it work
under Win32 too, so please keep the bug reports coming.

The other more esoteric APIs like SQLExtendedFetch() will have
to wait...

-- cheers,
Marc-Andre Lemburg


_______________
DB-SIG  - SIG on Tabular Databases in Python

send messages to: db-sig@python.org
administrivia to: db-sig-request@python.org
_______________