[Dbix-class] How to alter table via DBIC?

Chris Cole chris at compbio.dundee.ac.uk
Tue May 11 13:23:50 GMT 2010


On Tue, 11 May 2010 14:02:38 +0100, Rob Kinyon <rob.kinyon at gmail.com>  
wrote:

> On Tue, May 11, 2010 at 08:52, Chris Cole <chris at compbio.dundee.ac.uk>  
> wrote:
>> Hi,
>>
>> I have a partitioned Oracle table that I want add data to, but it needs  
>> to
>> be done on named partitions. Before I can insert the data I need to  
>> create a
>> new partition. Manually, this is done via an ALTER TABLE statement, but  
>> I
>> can't see anywhere on how to do this from within DBIC. Is this  
>> possible, at
>> all?
>
> I hope someone will give you a better answer than this, but you should
> know about one of the "escape hatches".
>
> $schema->storage->dbh_do( sub {
>     my $dbh = shift;
>
>     # At this point, you have the raw DBI $dbh that you would get from
> DBI->connect
>     # So, you can literally do whatever you want here.
> });
>
> HTH
> Rob

Ah, that's useful to know.
Thanks,

Chris



More information about the DBIx-Class mailing list