Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Makes the shell recognize new Cypher clauses #624

Merged
merged 1 commit into from

2 participants

@systay
Owner

No description provided.

@tinwelint tinwelint merged commit 1d077aa into neo4j:2.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 14, 2013
  1. @systay
This page is out of date. Refresh to see the latest.
View
28 community/shell/src/main/java/org/neo4j/shell/kernel/apps/cypher/Drop.java
@@ -0,0 +1,28 @@
+/**
+ * Copyright (c) 2002-2013 "Neo Technology,"
+ * Network Engine for Objects in Lund AB [http://neotechnology.com]
+ *
+ * This file is part of Neo4j.
+ *
+ * Neo4j is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.neo4j.shell.kernel.apps.cypher;
+
+import org.neo4j.helpers.Service;
+import org.neo4j.shell.App;
+
+@Service.Implementation( App.class )
+public class Drop extends Start
+{
+}
View
28 community/shell/src/main/java/org/neo4j/shell/kernel/apps/cypher/Match.java
@@ -0,0 +1,28 @@
+/**
+ * Copyright (c) 2002-2013 "Neo Technology,"
+ * Network Engine for Objects in Lund AB [http://neotechnology.com]
+ *
+ * This file is part of Neo4j.
+ *
+ * Neo4j is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.neo4j.shell.kernel.apps.cypher;
+
+import org.neo4j.helpers.Service;
+import org.neo4j.shell.App;
+
+@Service.Implementation( App.class )
+public class Match extends Start
+{
+}
View
19 community/shell/src/main/java/org/neo4j/shell/kernel/apps/cypher/Profile.java
@@ -19,13 +19,18 @@
*/
package org.neo4j.shell.kernel.apps.cypher;
-import org.neo4j.helpers.Service;
-import org.neo4j.shell.*;
-
import java.rmi.RemoteException;
+
import org.neo4j.cypher.CypherException;
import org.neo4j.cypher.javacompat.ExecutionEngine;
import org.neo4j.cypher.javacompat.ExecutionResult;
+import org.neo4j.helpers.Service;
+import org.neo4j.shell.App;
+import org.neo4j.shell.AppCommandParser;
+import org.neo4j.shell.Continuation;
+import org.neo4j.shell.Output;
+import org.neo4j.shell.Session;
+import org.neo4j.shell.ShellException;
@Service.Implementation( App.class )
public class Profile extends Start
@@ -48,18 +53,16 @@ public String getDescription()
protected Continuation exec( AppCommandParser parser, Session session, Output out )
throws ShellException, RemoteException
{
- String query = parser.getLine();
+ String query = parser.getLineWithoutApp();
if ( isComplete( query ) )
{
- String queryWithoutSemicolon = query.substring( "PROFILE".length(), query.lastIndexOf( ";" ) );
-
ExecutionEngine engine = new ExecutionEngine( getServer().getDb(), getCypherLogger() );
try
{
- ExecutionResult result = engine.profile(queryWithoutSemicolon, getParameters(session));
+ ExecutionResult result = engine.profile( query, getParameters( session ) );
out.println( result.dumpToString() );
- out.println( result.executionPlanDescription().toString());
+ out.println( result.executionPlanDescription().toString() );
} catch ( CypherException e )
{
throw ShellException.wrapCause( e );
Something went wrong with that request. Please try again.