You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Effortlessly control to worlds' most powerful graph database
11
-
- Pick and choose your drivers with easy configuration
12
-
- Intuitive API
13
-
- Extensible
14
-
- Designed, built and tested under close supervision with the official neo4j driver team
15
-
- Validated with [testkit](https://github.com/neo4j-drivers/testkit)*
16
-
- Fully typed with [psalm](https://psalm.dev/)
17
-
18
-
*(\*) full testkit integration is planned for version 2.1*
11
+
- Pick and choose your drivers with easy configuration
12
+
- Intuitive API
13
+
- Extensible
14
+
- Designed, built and tested under close supervision with the official neo4j driver team
15
+
- Validated with [testkit](https://github.com/neo4j-drivers/testkit)*
16
+
- Fully typed with [psalm](https://psalm.dev/)
17
+
18
+
*(\*) version 2.1 will integrate psalm *
19
19
## See the driver in action
20
20
21
-
An example project exists on the [neo4j github](https://github.com/neo4j-examples/movies-neo4j-php-client). It uses Slim and neo4j-php-client to build an api for the classic movies example of neo4j.
21
+
An example project exists on the [neo4j github](https://github.com/neo4j-examples/movies-neo4j-php-client). It uses Slim and neo4j-php-client to build an API for the classic movie's example of neo4j.
22
22
23
23
## Start your driving experience in three easy steps
You have now created a client with **bolt, https and neo4j drivers**. The default driver that the client will use is **bolt**.
46
+
You have now created a client with **bolt, HTTPS and neo4j drivers**. The default driver that the client will use is **bolt**.
47
47
48
-
Read more about the urls and how to use them to configure drivers [here]().
48
+
Read more about the URLs and how to use them to configure drivers [here]().
49
49
50
50
### Step 3: run a transaction
51
51
@@ -63,19 +63,19 @@ echo $result; // echos 'z'
63
63
## Decide how to send your Cypher queries
64
64
65
65
You can control the driver using three different approaches:
66
-
-*Transaction functions* (recommended and portable)
67
-
-*Auto committed queries* (easiest and most intuitive)
68
-
-*Unmanaged transactions* (for the highest degree of control)
66
+
-*Transaction functions* (recommended and portable)
67
+
-*Auto committed queries* (easiest and most intuitive)
68
+
-*Unmanaged transactions* (for the highest degree of control)
69
69
70
70
### Transaction functions
71
71
72
72
Transaction functions are the **de facto** standard when using the driver. It is the most portable as it is resistant to a lot of the pitfalls when first developing with high availability solutions such as [Neo4j aura](https://neo4j.com/blog/neo4j-aura-enterprise-ga-release/) or a [cluster](https://neo4j.com/docs/operations-manual/current/clustering/).
73
73
74
-
Transaction functions are managed by the driver:
75
-
- It **re-executes** the function in case of a [transient error](https://neo4j.com/docs/status-codes/current/#_classifications).
76
-
- It **commits** the transaction on successful execution
77
-
- It **rolls back** the transaction in case of a timeout.
78
-
- It **routes** the execution to a relevant follower or leader server when the neo4j protocol is enabled.
74
+
The driver manages transaction functions:
75
+
- It **re-executes** the function in case of a [transient error](https://neo4j.com/docs/status-codes/current/#_classifications).
76
+
- It **commits** the transaction on successful execution
77
+
- It **rolls back** the transaction in case of a timeout.
78
+
- It **routes** the execution to a relevant follower or leader server when the neo4j protocol is enabled.
79
79
80
80
> ATTENTION: Because of the automatic retry functionality, the function should produce the same result on subsequent recalls, or in more technical terms: should be **idempotent**. Always remember this when designing the execution logic within the function.
Auto committed queries are the simplest and most intuitive, but have a lot of drawbacks when running complex business logic or within a high availability environment.
114
+
Auto committed queries are the most straightforward and most intuitive but have many drawbacks when running complex business logic or within a high availability environment.
The `runStatements` method will run all the statements at once. This method is an essential tool to reduce the number of database calls, especially useful when using the HTTP protocol.
137
+
The `runStatements` method will run all the statements at once. This method is an essential tool to reduce the number of database calls, especially when using the HTTP protocol.
If you need lowerlevel access to the drivers capabilities, then you want unmanaged transactions. They allow for completely controllable commits and rollbacks.
150
+
If you need lower-level access to the drivers' capabilities, then you want unmanaged transactions. They allow for completely controllable commits and rollbacks.
151
151
152
152
#### Opening a transaction
153
153
@@ -207,7 +207,7 @@ foreach ($results as $result) {
207
207
}
208
208
```
209
209
210
-
Cypher values and types are mapped to php types and classes:
210
+
Cypher values and types map to these php types and classes:
211
211
212
212
|Cypher|Php|
213
213
|---|---|
@@ -231,7 +231,7 @@ Cypher values and types are mapped to php types and classes:
231
231
232
232
(*) A point can be one of four types implementing PointInterface: `\Laudis\Neo4j\Types\CartesianPoint``\Laudis\Neo4j\Types\Cartesian3DPoint``\Laudis\Neo4j\Types\WGS84Point``\Laudis\Neo4j\Types\WGS843DPoint`
233
233
234
-
If you want the results to be just a set of rows, columns, arrays and scalar types you can use a BasicFormatter:
234
+
If you want the results to be just a set of rows, columns, arrays and scalar types, you can use a BasicFormatter:
235
235
236
236
```php
237
237
use Laudis\Neo4j\ClientBuilder;
@@ -256,7 +256,7 @@ foreach ($results as $result) {
256
256
257
257
### Differentiating between parameter type
258
258
259
-
Cypher has lists and maps. This notion can be problematic as the standard php arrays encapsulate both. When you provide an empty array as a parameter, it will be impossible to determine if it is an empty list or map.
259
+
Cypher has lists and maps. This notion can be problematic as the standard php arrays encapsulate both. When you provide an empty array as a parameter, it will be impossible to determine an empty list or map.
260
260
261
261
The `ParameterHelper` class is the ideal companion for this:
262
262
@@ -288,7 +288,7 @@ $client->run('MATCH (x) WHERE x.slug in $listOrMap RETURN x', ['listOrMap' => []
288
288
| Aura | Yes |
289
289
| Jolt Protocol | Roadmap |
290
290
291
-
## Indepth requirements
291
+
## In-depth requirements
292
292
293
293
* PHP >= 7.4
294
294
* A Neo4j database (minimum version 3.5)
@@ -316,9 +316,9 @@ If you plan on using the Bolt protocol, make sure you have the sockets extension
316
316
317
317
## Concepts
318
318
319
-
The client is based on the driver api found[here](https://neo4j.com/docs/driver-manual/current/). Because of this, the client is nothing more than a driver manager. The driver creates sessions. A session runs queries through a transaction.
319
+
The driver API described[here](https://neo4j.com/docs/driver-manual/current/) is the main target of the driver. Because of this, the client is nothing more than a driver manager. The driver creates sessions. A session runs queries through a transaction.
320
320
321
-
Because of this behavior you can access each concept starting from the client like this:
321
+
Because of this behaviour, you can access each concept starting from the client like this:
322
322
323
323
```php
324
324
use Laudis\Neo4j\ClientBuilder;
@@ -345,7 +345,7 @@ A **client** manages **drivers** and routes the queries to the correct drivers b
345
345
346
346
### Driver
347
347
348
-
The **Driver** object is the thread-safe backbone that gives access to Neo4j. It owns a connection pool, through which all database connectivity occurs, and can spawn **sessions** for carrying out work
348
+
The ** driver** object is the thread-safe backbone that gives access to Neo4j. It owns a connection pooland can spawn **sessions** for carrying out work.
349
349
350
350
### Session
351
351
@@ -357,18 +357,18 @@ The **Driver** object is the thread-safe backbone that gives access to Neo4j. It
357
357
358
358
### Statement
359
359
360
-
**Queries** are executable units within **transactions**, and are comprised of a Cypher string and a keyed parameter set. Each query outputs a **result** that may contain zero or more **records**.
360
+
**Queries** are executable units within **transactions** and consist of a Cypher string and a keyed parameter set. Each query outputs a **result** that may contain zero or more **records**.
361
361
362
362
### Result
363
363
364
364
A **result** contains the output from a **query**, made up of header metadata, content **records** and summary metadata. In Neo4j 4.0 and above, applications have control over the flow of result data.
365
365
366
366
367
-
## Indepth configuration
367
+
## In-depth configuration
368
368
369
369
### Url Schemes
370
370
371
-
The url scheme is the easiest way to configure the driver.
371
+
The URL scheme is the easiest way to configure the driver.
0 commit comments