Skip to content
Permalink
Browse files

bundle: another attempt at bundling extensions now that meta.function…

… is fast. still slow.
  • Loading branch information...
erichanson committed Apr 26, 2019
1 parent 4d21dc2 commit fe60e29eec4210cae940fea50813a56942f6ee60
Showing with 49 additions and 6 deletions.
  1. +48 −5 extension-to-bundle.sql
  2. +1 −1 src/pg-extension/meta/001-catalog.sql
@@ -11,12 +11,53 @@ create extension if not exists plv8;
create extension meta;
create extension bundle;


------------------------------------------------------------------------
-- track meta entities
------------------------------------------------------------------------
insert into bundle.trackable_nontable_relation (pk_column_id) values

-- here are all the views in the meta extension, along with reasons why they may not be supported

-- (meta.column_id('meta','cast','id')),
(meta.column_id('meta','column','id')),
-- (meta.column_id('meta','connection','id')), -- makes no sense
(meta.column_id('meta','constraint_check','id')),
(meta.column_id('meta','constraint_unique','id')),
-- (meta.column_id('meta','extension','id')), -- right now extensions are managed manually
(meta.column_id('meta','foreign_column','id')),
(meta.column_id('meta','foreign_data_wrapper','id')),
(meta.column_id('meta','foreign_key','id')),
(meta.column_id('meta','foreign_server','id')),
(meta.column_id('meta','foreign_table','id')),
-- (meta.column_id('meta','function','id')), -- slow as heck, replaced with function_definition
-- (meta.column_id('meta','function_parameter','id')), -- " "
(meta.column_id('meta','function_definition','id')),
(meta.column_id('meta','operator','id')),
-- (meta.column_id('meta','policy','id')), -- haven't thought through how vcs on permissions would work
-- (meta.column_id('meta','policy_role','id')),
-- (meta.column_id('meta','relation','id')), -- no update handlers on relation, never will be. handled by table, view etc.
-- (meta.column_id('meta','relation_column','id')),
-- (meta.column_id('meta','role','id')), -- not sure how vcs on roles would work
-- (meta.column_id('meta','role_inheritance','id')),
(meta.column_id('meta','schema','id')),
(meta.column_id('meta','sequence','id')),
(meta.column_id('meta','table','id')),
-- (meta.column_id('meta','table_privilege','id')),
(meta.column_id('meta','trigger','id')),
-- (meta.column_id('meta','type','id')), -- replaced by type_definnition
(meta.column_id('meta','type_definition','id')),
(meta.column_id('meta','view','id'));


------------------------------------------------------------------------
-- bundle
------------------------------------------------------------------------
set search_path=bundle;

insert into bundle.bundle (name) values ('org.aquameta.core.bundle');
-- insert into bundle.bundle (name) values ('org.aquameta.core.bundle');



-- TODO: track the ignored_rows

@@ -67,6 +108,12 @@ select bundle.checkout((select head_commit_id from bundle.bundle where name='org



------------------------------------------------------------------------
-- endpoint
------------------------------------------------------------------------
create extension filesystem;


------------------------------------------------------------------------
-- endpoint
------------------------------------------------------------------------
@@ -170,7 +217,3 @@ select bundle.commit('org.aquameta.core.semantics','initial import');
drop extension semantics;
drop schema semantics;
select bundle.checkout((select head_commit_id from bundle.bundle where name='org.aquameta.core.semantics'));




@@ -822,7 +822,7 @@ select
meta.function_id( pronamespace::pg_catalog.regnamespace::text, proname::text, regexp_split_to_array(pg_catalog.pg_get_function_arguments(p.oid),', ')) as id,
pg_catalog.pg_get_functiondef_no_searchpath(p.oid) as definition
from pg_catalog.pg_proc p
where prokind='a'; -- why?? otherwise I get "ERROR: "sum" is an aggregate function"
where prokind != 'a'; -- why?? otherwise I get "ERROR: "sum" is an aggregate function"


create function meta.stmt_function_definition_create(definition text) returns text as $$

0 comments on commit fe60e29

Please sign in to comment.
You can’t perform that action at this time.