[DB-SIG] Constructors for varchar & numeric types?

Stuart Bishop zen@shangri-la.dropbear.id.au
Thu, 28 Jun 2001 11:06:58 +1000 (EST)


I'm preparing a second draft of the pre-PEP I sent out to this
SIG last week. Some feedback I received talked about datatype
limitations in different vendors systems, in particular the
different limitations in VARCHAR field lengths.

Is it a good idea to encode database meta information in
the drivers (datatype lengths, numeric precisions etc)?
If I remember correctly, there was a project last year
to put this sort of information into a seperate module.
(I'll trawl the archives when I have time for the thread).

If this information is available, I can provide
VARCHAR, NUMBER, RAW objects etc. that will do type checking
so paranoid programmers can ensure exceptions will be thrown by
Python if limitations are exceeded (as opposed to hoping the RDBMS
throws an exception rather than just truncating or rounding the value).
Would people use such a feature? I know I personally have always
relied on exceptions being thrown from the RDBMS...

-- 
Stuart Bishop <zen@shangri-la.dropbear.id.au>