This handles the work of injecting and ejecting access policies SDL strings into our schema files in the appropriate spots.
The actual business logic for what these APs should be is stubbed & coming next.
I built out a crude AST parser to facilitate this. It's based on a recursive regex { } block matching.
I've added specific Module & Type AST nodes to facilitate traversal for our needs.
I've also have some string manipulation & filesystem helpers for our needs.
CLI commands
Add APs to schema files
yarn console edgedb ap inject
Remove generated APs from schema files
yarn console edgedb ap eject
Run an edgedb migration command with APs injected, then eject them back out.
yarn edgedb:migration status
yarn edgedb:migration create
This handles the work of injecting and ejecting access policies SDL strings into our schema files in the appropriate spots. The actual business logic for what these APs should be is stubbed & coming next.
I built out a crude AST parser to facilitate this. It's based on a recursive regex
{ }
block matching. I've added specific Module & Type AST nodes to facilitate traversal for our needs. I've also have some string manipulation & filesystem helpers for our needs.CLI commands
Add APs to schema files
Remove generated APs from schema files
Run an
edgedb migration
command with APs injected, then eject them back out.