use of org.neo4j.kernel.impl.query.QueryExecutionEngine in project neo4j by neo4j.
the class BuiltInDbmsProcedures method listFunctions.
@Deprecated(since = "4.3.0", forRemoval = true)
@SystemProcedure
@Description("List all functions in the DBMS.")
@Procedure(name = "dbms.functions", mode = DBMS, deprecatedBy = "SHOW FUNCTIONS command")
public Stream<FunctionResult> listFunctions() {
DependencyResolver resolver = graph.getDependencyResolver();
QueryExecutionEngine queryExecutionEngine = resolver.resolveDependency(QueryExecutionEngine.class);
List<FunctionInformation> providedLanguageFunctions = queryExecutionEngine.getProvidedLanguageFunctions();
var globalProcedures = resolver.resolveDependency(GlobalProcedures.class);
// gets you all functions provided by the query language
Stream<FunctionResult> languageFunctions = providedLanguageFunctions.stream().map(FunctionResult::new);
// gets you all non-aggregating functions that are registered in the db (incl. those from libs like apoc)
Stream<FunctionResult> loadedFunctions = globalProcedures.getAllNonAggregatingFunctions().map(f -> new FunctionResult(f, false));
// gets you all aggregation functions that are registered in the db (incl. those from libs like apoc)
Stream<FunctionResult> loadedAggregationFunctions = globalProcedures.getAllAggregatingFunctions().map(f -> new FunctionResult(f, true));
return Stream.concat(Stream.concat(languageFunctions, loadedFunctions), loadedAggregationFunctions).sorted(Comparator.comparing(a -> a.name));
}
Aggregations