I am about to finally ditch DBIx::Class, as I spend far too much time figuring out how to make it do what I want it to do (my IQ is simply not up to it), but does by any chance someone know how to generate primary keys from a sequence in DBIx::Class?
I have tried this approach:
But when I then try this:__PACKAGE__->add_columns( id => { data_type => 'integer', size + => 16, sequence => "stream_seq" }, ...
I get an error (sequence STREAM_SEQ_CURRVAL is not yet defined in this session).my $s = $schema->resultset('Stream')->new({}); $s->insert;
The problem seems to be that PK::Auto seems to expect a trigger that populates the primary key column but I would prefer a solution where I don't define a trigger but rather have DBIx::Class generate an insert-statement that uses the sequence directly - is that possible (and if so how)?
And please don't point me to CPAN-modules you have not used yourself...
Many thanks!
In reply to DBIx::Class and Oracle sequences by morgon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |