ExternalPredicateCallback is used to query external data sources. An atom `mydb(input1, ..., inputN, OutputVar1, ..., OutputVarN)` is evaluated as follows: - the engine checks whether the fact store contains any facts of the shape `mydb(input1, ..., inputN, _, ..., _)`. If so, we use those for eval
| 83 | // but is also free to ignore them. In any case, when constant filter arguments |
| 84 | // are present, only matching facts will be added to the store. |
| 85 | type ExternalPredicateCallback interface { |
| 86 | // If true, the engine will pass any subgoals of the clause that mention output variables |
| 87 | // to ExecuteQuery. Otherwise, the pushdown argument will be empty. |
| 88 | ShouldPushdown() bool |
| 89 | ShouldQuery(inputs []ast.Constant, filters []ast.BaseTerm, pushdown []ast.Term) bool |
| 90 | ExecuteQuery(inputs []ast.Constant, filters []ast.BaseTerm, pushdown []ast.Term, |
| 91 | cb func([]ast.BaseTerm)) error |
| 92 | } |
| 93 | |
| 94 | // EvalOptions are used to configure the evaluation. |
| 95 | type EvalOptions struct { |
no outgoing calls
no test coverage detected