dbsrgits / dbix-class-schema-loader

Official GitHub remote for git.shadowcat.co.uk DBIx-Class-Schema-Loader.git
http://dbix-class.org/
11 stars 34 forks source link

this patch allows us to extract DDL for materialized views for oracle #25

Open dr-kd opened 2 years ago

dr-kd commented 2 years ago

This PR allows oracle's materialised views to be ingested as views by Schema::Loader.

TODO: Nothing done so far to ensure the correct DDL is emitted - and with oracle's refresh scheduling statement too

I'd like some guidance about if this is the correct approach, and where I should look to get the view_definition to ingest the fuller materialised view ddl statement for example:

create materialized view mv_alternatives
refresh next trunc(sysdate + 1) + 6/24
as
    select  alts.identifier,
            count(*) as alternatives
    from    (
                select distinct(identifier) from item_alternate
                union all
                select distinct(identifier) from item_replacement
            ) alts
    group by alts.identifier