[Dbix-class] Exceptions per DB system
Vangelis Katsikaros
ibob17 at yahoo.gr
Fri Apr 5 14:42:01 GMT 2013
Hi Frew
On 04/04/2013 04:12 PM, Frew Schmidt wrote:
> On Thu, Apr 04, 2013 at 12:50:19PM +0300, Vangelis Katsikaros wrote:
>> Hi
>>
>> I sent this question about 1 month ago but got no answer. Perhaps there is
>> something more I could add to make the question more specific, or I could
>> add some information to make it more clear/easy to answer?
>>
>> Regards
>> Vangelis
>>
>
> Ok, I wrote DBIE and I regret ever having given that talk :( DBIE is
> very not ready for public consumption. I would not recommend anyone
> use it at all. I have not given up on it and even use it here and
> there at work, but it is missing a few major pieces.
Oh, I see. So, it seems that there are options
- simply catch whether an exception occurred without focusing on the
specifics of the exception
- or end up with string matching for some common cases I see. However, I
shouldn't rely on them to work out of the box when up|downgrading versions.
BTW, I use mysql in case this helps somehow this part of the discussion.
> 1: We need to be able to accurately introspect a significant number
> of facts from the $dbh, such as the backend RDBMS, the version of
> said RDBMS, and sometimes even more. This should be it's own module
> so that DBIE and DBIC and other modules can use it. In the past I've
> considered implementing it myself with reblessing, the way DBIC does
> it, but people smarter than me recommend a more structured approach,
> where you ask for each rebless in turn when you need it. If I had
> the wherewithal for it I'd pay money for this to be implemented. It
> is a very useful thing that a lot of people don't even know they need
> (because they assume people only use Pg or Mysql.)
>
> 2: We need both offline (mocked) tests and online tests. The offline
> ones are critical for any kind of serious dev, the online are
> critical for us to keep the project going as new databases are
> released, so we can figure out what new errors look like.
> Some of the hard problems from when I started DBIE are actually
> solved, for instance when I started I used the abhorrent
> Exception::Class, but now that Throwable has been ported to Moo that's
> a perfectly good solution.
>
> I guess if someone out there could help me implement a design spec for
> "DBIx::DBH::Introspector" (ribasushi? mst?) or the online/offline test
> suite for 4 exceptions and 3 databases, say:
>
> MySQL PG SQLite
> NotUnique
> BrokenFK
> Truncation
> WrongDatatype
>
> That would be enough for me to attempt going forward. Otherwise,
> don't hold your breath, it could be a while :)
For the second part for the discussion, I am afraid I cannot add much as
I am not experienced with internals of DBIx and the several DB* components.
In case it helps, I offer myself to chip in some manpower provided there
is some guidance.
Thanks
Vangelis
More information about the DBIx-Class
mailing list