Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameters #122

Merged
merged 2 commits into from
Jun 26, 2023
Merged

Parameters #122

merged 2 commits into from
Jun 26, 2023

Commits on Jun 26, 2023

  1. parser: support for parameter substitution

    Parsed datalog snippets can now contain placeholders (for instance: `check if right({resource}, {operation}`). This allows embedding dynamic values in datalog, without the risk of injections.
    
    All the `FromString*` methods now have a `FromString*WithParams` counterpart that take an extra
    `map[string]Term` value.
    
    /!\ For now, it is the caller's responsibility to make sure the all the placeholders **in expressions** have a corresponding value defined (same as making sure sets don't contain variables).
    Placeholders set in predicates don't have this issue. This is an underlying issue of the parser; it was not introduced by this change.
    divarvel committed Jun 26, 2023
    Configuration menu
    Copy the full SHA
    b589ec1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    024d556 View commit details
    Browse the repository at this point in the history