File tree Expand file tree Collapse file tree 3 files changed +51
-6
lines changed Expand file tree Collapse file tree 3 files changed +51
-6
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,4 @@ create user mark with encrypted password 'mark';
22create role administrator;
33create role marketing;
44grant marketing to mark;
5- grant administrator to postgres;
6- -- Grant select access to user 'other' on all (including future) tables
7- -- alter default privileges in schema public grant all on tables to other;
5+ grant administrator to postgres;
Original file line number Diff line number Diff line change @@ -67,4 +67,51 @@ def to_datacontract_cli(contract):
6767 }
6868
6969
70- return data
70+ return data
71+
72+ def to_pace (contract ):
73+ # The schema
74+ fields = []
75+ for column in contract ["columns" ]:
76+ fields .append ({
77+ 'name_parts' : [column ["name" ]],
78+ 'type' : column ["data_type" ].lower (),
79+ })
80+
81+ # The access policies
82+ conditions = []
83+ for policy in contract ["access" ]:
84+ conditions .append (dict (
85+ principals = policy .get ("principals" , []),
86+ condition = policy .get ("condition" )
87+ ))
88+
89+ filters = [dict (
90+ generic_filter = dict (
91+ conditions = conditions
92+ )
93+ )]
94+
95+ return dict (
96+ metadata = dict (
97+ title = f"public.{ contract ['dataset' ]} " ,
98+ ),
99+ source = dict (
100+ ref = dict (
101+ integration_fqn = f"public.{ contract ['dataset' ]} " ,
102+ platform = dict (
103+ id = "postgres" ,
104+ platform_type = "POSTGRES" ,
105+ )
106+ ),
107+ fields = fields ,
108+ ),
109+ rule_sets = [dict (
110+ target = dict (
111+ ref = dict (
112+ integration_fqn = f"public.{ contract ['dataset' ]} _view" ,
113+ ),
114+ ),
115+ filters = filters ,
116+ )]
117+ )
Original file line number Diff line number Diff line change 11spring :
22 datasource :
3- url : jdbc:postgresql://postgres_pace:5431 /pace
3+ url : jdbc:postgresql://postgres_pace:5432 /pace
44 hikari :
55 username : pace
66 password : pace
1010 expose-application-exceptions : true
1111 processing-platforms :
1212 postgres :
13- - id : " sample-connection "
13+ - id : " postgres "
1414 host-name : " postgres"
1515 port : 5432
1616 user-name : " postgres"
You can’t perform that action at this time.
0 commit comments