My current Perl Ironman Challenge status is: My Ironman Badge

Tuesday, February 2, 2010

DBIC::API Update

Be prepared, folks. The next installment of DBIC::API will be backwards compatible breaking. This means if you were relying on the old behavior of manipulating the stash for large swaths customization, your customizations will no longer work. The version number will jump significantly in case this isn't warning enough.

So far, the Changes will look something like this:
  • Merge create and update into update_or_create
  • object is much advanced now:
    • Identifier can be omitted, and data_root in the request is interpreted
  • Because of the above one object or several is now possible for update or create
  • Create and Update object validation now happens iteratively
  • Creates and Updates can be mixed inside a single bulk request
  • All modifying actions on the database occur within an all-or-nothing transaction
  • Much of the DBIC search parameter munging is properly moved to the RequestArguments Role in the form of a trigger on 'search' to populate 'search_parameters' and 'search_attributes' which correspond directly to ->search($parameters, $attributes);
  • Error handling is now much more consistent, using Try::Tiny everywhere possible
  • Tests are now modernized and use JSON::Any
  • Extending is now explicitly done via Moose method modifiers
  • The only portion of the stash in use is to allow runtime definition of create/update_allows
  • list is now broken down into several steps:
    • list_munge_parameters
    • list_perform_search
    • list_format_output
    • row_format_output (which is just a passthrough per row)
There will likely be a couple of more bullet points, but as can be plainly seen, this is a BIG update. I hope to have the tests and the distribution ready to ship to CPAN tomorrow late in the day (it is still sitting in my local SVK repo)

This update will bring DBIC::API to the next level in terms of using it as a web service, with more functionality built into the core by default.

If you happen to be attending Frozen Perl 2010, I'll be giving a presentation on Catalyst datagrids, specifically my melding of ExtJS with DBIC::API and how dumb easy it is to hook the two together now (which makes my work life much simpler).

Anyhow, if you are still doing lots of heavy, custom CRUD exposed via web service, I hope this update will make it more appealing to switch to DBIC::API to handle the more mundane parts.

1 comment:

  1. cool, looking forward to seeing this. I might start running from the repo version since I have a brand new application that could use this. Now I just need to get patches into Test::WWW:Mechanize so I can install DBIC::API without forcing :)