[Dbix-class] Some patch contributions...

Jason Kohles email at jasonkohles.com
Fri Dec 30 20:13:24 CET 2005


Thanks to some helpful folks and a lot of code-reading, I've managed
to convert all of my Class::DBI code over to DBIx::Class without using
CDBICompat.  So far I'm liking it much better (especially following
the switch to C3, which solved some of the inheritance problems I was
running into before.)

Along the way I found some bugs, some documentation problems, and some
stuff to contribute, which I hope you don't mind receiving all at
once.  Not sure what format you guys prefer diffs in, let me know if
you would prefer something other than straight 'svn diff'...

Patches attached are:

uuidcolumns.diff - DBIx::Class::UUIDColumns
    DBIx::Class::UUIDColumns is fairly inefficient with it's handling
of Data::UUID objects, creating
    not one but two new objects for every UUID you want to create. 
This patch allows it to reuse
    a single Data::UUID object when creating later UUIDs, and stops
creating a new Data::UUID
    object just to convert from a binary UUID to a string.

    Quick non-scientific benchmark over 50,000 iterations:
                           Rate          Old Way  New Way
        Old Way   1144/s        --              -99%
        New Way 102041/s   8822%    --

cookbook-cleanup.diff - DBIx::Class::Manual::Cookbook
    Removes an extraneous '=back' from Manual/Cookbook.pod to
eliminate a pod parsing
    warning, start with a blank line to prevent problems with some
versions of various pod
    parsers, add a SEE ALSO section pointing at the other relevant docs.

loader.diff - DBIx::Class::Loader
    Some documentation cleanup (mostly grammar and incomplete thoughts
turned into actual
    sentences) although some of the example code was wrong as well. 
Changed to use
    UNIVERSAL::require instead of eval for loading the implementation
(which makes it a bit
    easier to read, and since DBIx::Class requires UNIVERSAL::require
anyway, it doesn't add
    any new dependencies).

cookbook-loader.diff - DBIx::Class::Manual::Cookbook
    My contribution to the cookbook, using DBIx::Class::Loader with
support code for each table
    class in external files, keeps things nice and neat, and makes it
a little easier to mange (IMHO)

--
Jason Kohles
email at jasonkohles.com - http://www.jasonkohles.com/
"A witty saying proves nothing."  -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: uuidcolumns.diff
Type: application/octet-stream
Size: 395 bytes
Desc: not available
Url : http://lists.rawmode.org/pipermail/dbix-class/attachments/20051230/a7969608/uuidcolumns.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cookbook-cleanup.diff
Type: application/octet-stream
Size: 400 bytes
Desc: not available
Url : http://lists.rawmode.org/pipermail/dbix-class/attachments/20051230/a7969608/cookbook-cleanup.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: loader.diff
Type: application/octet-stream
Size: 2805 bytes
Desc: not available
Url : http://lists.rawmode.org/pipermail/dbix-class/attachments/20051230/a7969608/loader.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cookbook-loader.diff
Type: application/octet-stream
Size: 2822 bytes
Desc: not available
Url : http://lists.rawmode.org/pipermail/dbix-class/attachments/20051230/a7969608/cookbook-loader.obj


More information about the Dbix-class mailing list