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

Replace usage of removed db.indexes() with SHOW INDEXES #2326

Merged
merged 1 commit into from
Nov 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ private void exportSchema(PrintWriter out) {
}

private List<String> exportIndexes() {
return db.executeTransactionally("CALL db.indexes()", Collections.emptyMap(), result -> result.stream()
return db.executeTransactionally("SHOW INDEXES", Collections.emptyMap(), result -> result.stream()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we presume that the result columns have not changed between these two calls?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, there is one change: "provider" is replaced by "indexProvider"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But from what I could see in this method we never care about that field so I think we are good.

.map(map -> {
if ("LOOKUP".equals(map.get("type"))) {
return "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.neo4j.driver.Record;
import org.neo4j.driver.Session;

import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import org.neo4j.driver.Record;
import org.neo4j.driver.Session;

import static apoc.util.TestContainerUtil.createEnterpriseDB;
import static apoc.util.TestContainerUtil.testCall;
import static apoc.util.TestContainerUtil.testResult;
Expand Down Expand Up @@ -285,7 +286,7 @@ public void testIndexOnMultipleProperties() {
});

String indexName = session.readTransaction(tx -> {
String name = tx.run("CALL db.indexes() YIELD name RETURN name").single().get("name").asString();
String name = tx.run("SHOW INDEXES YIELD name RETURN name").single().get("name").asString();
tx.commit();
return name;
});
Expand Down
1 change: 0 additions & 1 deletion full/src/test/resources/signatures.csv
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,6 @@ db.index.fulltext.drop,db.index.fulltext.drop(indexName :: STRING?) :: VOID
db.index.fulltext.listAvailableAnalyzers,"db.index.fulltext.listAvailableAnalyzers() :: (analyzer :: STRING?, description :: STRING?)"
db.index.fulltext.queryNodes,"db.index.fulltext.queryNodes(indexName :: STRING?, queryString :: STRING?) :: (node :: NODE?, score :: FLOAT?)"
db.index.fulltext.queryRelationships,"db.index.fulltext.queryRelationships(indexName :: STRING?, queryString :: STRING?) :: (relationship :: RELATIONSHIP?, score :: FLOAT?)"
db.indexes,"db.indexes() :: (description :: STRING?, indexName :: STRING?, tokenNames :: LIST? OF STRING?, properties :: LIST? OF STRING?, state :: STRING?, type :: STRING?, progress :: FLOAT?, provider :: MAP?, id :: INTEGER?, failureMessage :: STRING?)"
db.labels,db.labels() :: (label :: STRING?)
db.propertyKeys,db.propertyKeys() :: (propertyKey :: STRING?)
db.relationshipTypes,db.relationshipTypes() :: (relationshipType :: STRING?)
Expand Down