Re: [Dbix-class] Exceptions per DB system
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 PGSQLite 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 ___ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk
Re: [Dbix-class] Exceptions per DB system
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. 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 PGSQLite 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 :) Lastly, if you can't wait, you might want to look at DBIx::Error. It's a simpler module that (afaik) only supports Pg. -- fREW Schmidt http://blog.afoolishmanifesto.com pgp_XNvbF0_cz.pgp Description: PGP signature ___ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk
Re: [Dbix-class] Exceptions per DB system
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 On 03/01/2013 06:59 PM, Vangelis Katsikaros wrote: Hi In http://afoolishmanifesto.com/dbie-intro/slideshow.html , slide "28 What it do's?", it's mentioned that not all DB systems are exception-supported. With DBIx::Class: 0.08127 and DBD::mysql: 4.012 I noticed from my logs that (at least) some exceptions are supported, for example: Exception::DB::Transaction error: DBIx::Class::ResultSet::update_or_new(): DBI Exception: DBD::mysql::st execute failed: Deadlock found when trying to get lock; Is there a list of exceptions supported by system? Regards Vangelis ___ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk ___ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk
[Dbix-class] Exceptions per DB system
Hi In http://afoolishmanifesto.com/dbie-intro/slideshow.html , slide "28 What it do's?", it's mentioned that not all DB systems are exception-supported. With DBIx::Class: 0.08127 and DBD::mysql: 4.012 I noticed from my logs that (at least) some exceptions are supported, for example: Exception::DB::Transaction error: DBIx::Class::ResultSet::update_or_new(): DBI Exception: DBD::mysql::st execute failed: Deadlock found when trying to get lock; Is there a list of exceptions supported by system? Regards Vangelis ___ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk