i should add that if there is a reasonable method of getting at error  
codes across most DBAPIs we can add a dialect method to refine it  
into an "error_code" attribute on SQLError.

On Aug 17, 2006, at 10:39 AM, Michael Bayer wrote:

>
> On Aug 17, 2006, at 3:31 AM, Karsten Hilbert wrote:
>
>> On Wed, Aug 16, 2006 at 09:09:21PM -0400, Michael Bayer wrote:
>>
>> SQLSTATE:
>>> this is more of a psycopg2 issue.
>> Not really. SQLSTATE is a SQL feature, not a feature of
>> psycopg2. Hence it'd make sense to report it right within
>> sqlalchemy.exceptions.SQLError for those databases which
>> have it implemented.
>
> Sorry, SA is only an interface to psycopg2 (or whatever DBAPI module
> youre using), and has no other access to the database's reported
> information otherwise.
>
>>> anything that psycopg2 reports is
>>> available in SA, such as exceptions which are wrapped in a
>>> sqlalchemy.exceptions.SQLError and are accessible via the "orig"
>>> parameter.
>> True enough but it'd leave me poking into a "psycopg"-only
>> structure when wanting to write non-psycopg-specific code
>> (one goal one wants to achieve when using SQLAlchemy).
>
> once again, SA is only a wrapper to DBAPIs.  if DBAPI had a standard
> way to report SQLSTATE, then we'd tack that onto the SQLError, but as
> far as I know, it doesnt.
>
>
>> Which would be the way to achieve that within the current SA
>> framework ?
>>
>
> you need a DBAPI implementation that supports SQLSTATE.
>
>
>
> ---------------------------------------------------------------------- 
> ---
> Using Tomcat but need to do more? Need to support web services,  
> security?
> Get stuff done quickly with pre-integrated technology to make your  
> job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache  
> Geronimo
> http://sel.as-us.falkag.net/sel? 
> cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Sqlalchemy-users mailing list
> Sqlalchemy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to