On 3/20/07, Jonathan Vanasco <[EMAIL PROTECTED]> wrote:
> I'd actually like to see sequence classes
>         Rose::DB::Object::Metadata::Sequence
>
> Which lets us map sequences to rose objects , and vice versa
>
> I'd like to be able to call
>
>         my $seq= MyApp::Rose::DB::Object::Sequence1->new();
>         my $curval= $seq->curval;
>         my $nextval= $seq->nextval;
>         my $lastval = $seq->lastval;

Well then code it up and send it to me :)  That level abstraction is
not strictly necessary to support the proposed feature (columns that
are not part of the PK but that have default values pulled from
sequences), but it might be useful nonetheless.

> getting that to work with all dbs might be a pain though.

Not really.  If you decide to do it, you'd delegate all db-specific
functionality to the "db" (Rose::DB) object.  As mentioned earlier in
this thread, there's already a vaguely cross-db-compatible
next_value_in_sequence() method in Rose::DB.  You'd just have to add
more such methods.  The Rose::DB::Sequence class wouldn't have any
db-specific code in it at all.

-John

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to