Enable schema declarations for policy tables

Registered by Tim Hinrichs

There is currently no way for a policy writer to specify the schema (column names) for a table introduced in policy. Once the policy engine knows the schema for a table, it can (i) do syntax checks to ensure rules use the proper number of columns and (ii) enable column-named references for those tables.

This would mean adding statements to the policy language such as schema[p("uuid", "name", "status")] to declare that table p has 3 columns named uuid, name, and status.

This change would also require changes to the policy engine. Currently, column-references are translated into positional-references at compile time because the only schemas that exist are known at compile-time. But once policy writers are free to add schema declarations via policy, the schema may not be known at the time the rule is inserted. Thus we must adapt the policy engine so it properly handles column-references during query evaluation.

There are some open questions that need to be answered. What happens when someone (i) adds a schema, (ii) writes rules using column references and (iii) removes and/or changes the schema? This sequence is problematic because we currently implement column-references by compiling away the references at read-time; hence, deleting the schema is impossible if there are column-references (without deleting the rules with col-references) and therefore updating the schema is impossible (without deleting the rules with col-references).

This blueprint requires a spec.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Medium
Drafter:
Tim Hinrichs
Direction:
Needs approval
Assignee:
None
Definition:
Discussion
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.