Skip to content

Commit

Permalink
implementation of the built in schema procedure
Browse files Browse the repository at this point in the history
  • Loading branch information
K-Jo committed Sep 15, 2016
1 parent e42a3e2 commit 80277e5
Show file tree
Hide file tree
Showing 5 changed files with 715 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.neo4j.kernel.api.proc.UserFunctionSignature;
import org.neo4j.kernel.impl.api.TokenAccess;
import org.neo4j.kernel.impl.api.index.IndexingService;
import org.neo4j.kernel.internal.GraphDatabaseAPI;
import org.neo4j.procedure.Context;
import org.neo4j.procedure.Description;
import org.neo4j.procedure.Name;
Expand All @@ -59,6 +60,9 @@ public class BuiltInProcedures
@Context
public DependencyResolver resolver;

@Context
public GraphDatabaseAPI graphDatabaseAPI;

@Description( "List all labels in the database." )
@Procedure( name = "db.labels", mode = READ )
public Stream<LabelResult> listLabels()
Expand Down Expand Up @@ -157,6 +161,13 @@ public void resampleOutdatedIndexes()
}
}

@Description( "Show the schema of the data." )
@Procedure(name = "db.schema", mode = READ)
public Stream<SchemaProcedure.GraphResult> metaGraph() throws ProcedureException
{
return Stream.of(new SchemaProcedure(graphDatabaseAPI, tx).buildSchemaGraph());
}

@Description( "List all constraints in the database." )
@Procedure( name = "db.constraints", mode = READ )
public Stream<ConstraintResult> listConstraints()
Expand Down

0 comments on commit 80277e5

Please sign in to comment.