[Dbix-class] Proposed readonly patch for DBIx::Class

Ben Tilly btilly at gmail.com
Wed Aug 10 22:05:53 GMT 2011


Often database schemas have tables that should not be changed at
runtime in the application.  It would be convenient to be able to mark
this fact in the class.  However to avoid accidents you wind up having
to override methods in both the Row class and the ResultSet class.
Having to synchronize changes to 2 classes is kind of messy.

The attached patch makes this look much nicer in the client code.
With this in the Result class you just say:

  __PACKAGE__->readonly(1);

and now you won't accidentally update that table from in Perl.  It can
be unset at any time and so doesn't provide any actual security, but
it is a useful hint.

Is there any possibility that this could be considered for inclusion
in DBIx::Class?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: readonly.diff
Type: application/octet-stream
Size: 7003 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20110810/52=
be0152/readonly.obj


More information about the DBIx-Class mailing list