[Dbix-class] RFC: Syntactic sugar

Brandon Black blblack at gmail.com
Wed Mar 29 19:33:45 CEST 2006


On 3/29/06, Matt S Trout <dbix-class at trout.me.uk> wrote:
> Somebody posted a proposal (and an evil Want hack as a possible
> implementation) for a neat bit of syntax, but (1) it's attached to an old
> thread, (2) it didn't particularly define what the syntax would do.
>
> But it's got me thinking about extra sugar again; we've now mostly got a core
> I'm happy to see serious sugar built on top of (all automagic and no
> primitives to fall back to was one of my great problems customising CDBI,
> hence my worrying about getting the basics right more than anything else
> recently).
>
> So, what things are you doing with DBIx::Class that works but where the syntax
> is clumsier or more verbose than they'd like, and what would your ideal
> interface to these things be? Lets get a discussion going (but stick to
> syntax, not implementation please; we'll figure out how to implement it once
> we've decided what we're actually trying to implement :)
>

package Foo::Schema;
use base qw/DBIx::Class::Schema/;

__PACKAGE__->declare( ... );

1;

Where ... could be a data structure, a string, a filehandle, a
filename, or undef to read from __DATA__

Or could even make a special subclass of Schema called
DBIx::Class::Schema::Declarative, that uses a source-filter (5.8.0+
only IIRC) to interpret the whole rest of the file as our invented
declarative syntax.

-- Brandon



More information about the Dbix-class mailing list