[DBIx-Class-Devel] [dbix-class] Disconnect after schema version check. (#57)

Peter Rabbitson notifications at github.com
Sun Sep 7 11:57:38 GMT 2014


@jeneric Right, so... I have been thinking how exactly to answer this. Make no mistake - I am not making this hard on purpose. The easiest thing to do would be to just show you the actual solution which is literally a 2 line diff (except the actual test, which is required to merge the work). However this will represent a lost teaching opportunity. After all I am not just trying to solve your problem, but hope you can gain an extra viewpoint in the process. 

Instead I want to understand where your confusion lies, and what docs I could improve to make sure it doesn't happen to others in the future. 

The immediate problem with your approach is that you are polluting the existing Schema. You kinda answer the question yourself in: `I'm uncertain why the class wasn't added to the schema in the past, could it have been that supporting methods weren't available to ensure that it wasn't touched during deploy?`. The reason it was never added is so that nothing *needs* to sanitize things after the fact. It is always easier to never add something, rather than removing it after the fact.

More fundamentally you seem to be going down the wrong path because you assume that `$schema_instance` == `separate connection`. This is completely untrue. Please reread the piece I linked to earlier in https://github.com/dbsrgits/dbix-class/pull/57#issuecomment-53374573: `...clearly you are looking into a shared $dbh as can be seen in the second bullet point here: https://metacpan.org/pod/DBIx::Class::Storage::DBI#connect_info.`

If after the above you are still not entirely sure what I keep suggesting and would rather just move on - let me know and I will fix the code in question.

Cheers and thank you for your patience ;)



---
Reply to this email directly or view it on GitHub:
https://github.com/dbsrgits/dbix-class/pull/57#issuecomment-54744656
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class-devel/attachments/20140907/7b17ba0c/attachment.htm>


More information about the DBIx-Class-Devel mailing list