Skip to content

Commit 03a060a

Browse files
authored
Merge pull request #6782 from mjfwebb/mjfwebb/introspector-use-execute-read
Update Introspector to use executeRead
2 parents 9b738ee + 51ae6ed commit 03a060a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.changeset/quick-moments-push.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@neo4j/introspector": patch
3+
---
4+
5+
Replaces usage of readTransaction with executeRead in introspector to pave the way for a future upgrade to neo4j-driver v6.

packages/introspector/src/to-internal-struct.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ async function introspectNodes(sessionFactory: () => Session): Promise<NodeMap>
5151
const nodes: NodeMap = {};
5252
// Label properties
5353
const session = sessionFactory();
54-
const labelPropsRes = await session.readTransaction((tx) =>
54+
const labelPropsRes = await session.executeRead((tx) =>
5555
tx.run(`CALL db.schema.nodeTypeProperties()
5656
YIELD nodeType, nodeLabels, propertyName, propertyTypes, mandatory
5757
RETURN *`)
@@ -85,7 +85,7 @@ async function introspectRelationships(sessionFactory: () => Session): Promise<R
8585
const rels: RelationshipMap = {};
8686

8787
// Find all relationship types and their properties (if any)
88-
const typePropsRes = await relSession.readTransaction((tx) =>
88+
const typePropsRes = await relSession.executeRead((tx) =>
8989
tx.run(`CALL db.schema.relTypeProperties()
9090
YIELD relType, propertyName, propertyTypes, mandatory
9191
RETURN *`)
@@ -114,7 +114,7 @@ async function introspectRelationships(sessionFactory: () => Session): Promise<R
114114
});
115115

116116
const escapedType = escapeLabel(cleanTypeName(relType));
117-
const relationshipsRes = await conSession.readTransaction((tx) =>
117+
const relationshipsRes = await conSession.executeRead((tx) =>
118118
tx.run(`
119119
MATCH (n)-[r:${escapedType}]->(m)
120120
WITH DISTINCT labels(n) AS from, labels(m) AS to

0 commit comments

Comments
 (0)