Skip to content

Commit 4492531

Browse files
New features & code cleanup
feat: HTTP/2 support feat: truncateCollection feat: getWritesExecuted feat: getCollectionDocumentCount refactor: moved client config to a config DTO refactor: moved client properties/methods related to handlers to specific traits. refactor: result cleanup moved to one generic location: cleanupResponse ci: added ARANGODB_VERSION env var for version specific feature testing
1 parent 1a59b4a commit 4492531

22 files changed

+530
-267
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,5 @@ jobs:
5050
run: |
5151
chmod +x "${GITHUB_WORKSPACE}/bin/qa.sh"
5252
"${GITHUB_WORKSPACE}/bin/qa.sh"
53+
env:
54+
ARANGODB_VERSION: ${{ matrix.arangodb }}

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,5 @@ $client->transactions()->begin(['write' => ['users', 'teams']]);
9393
5) [Transaction manager](docs/transaction-manager.md)
9494

9595
## Related packages
96-
[AQL query builder](https://github.com/LaravelFreelancerNL/fluentaql)
97-
98-
[ArangoDB Laravel Driver](https://github.com/LaravelFreelancerNL/laravel-arangodb)
96+
* [AQL query builder](https://github.com/LaravelFreelancerNL/fluentaql)
97+
* [ArangoDB Laravel Driver](https://github.com/LaravelFreelancerNL/laravel-arangodb)

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,17 @@
1919
"php": "^7.4|^8.0",
2020
"ext-json": "*",
2121
"guzzlehttp/guzzle": "^7.2",
22-
"halaxa/json-machine": "^0.6.0"
22+
"halaxa/json-machine": "^0.6.0",
23+
"spatie/data-transfer-object": "^2.8"
2324
},
2425
"require-dev": {
2526
"phpunit/phpunit": "^9.5",
2627
"phpstan/phpstan": "^0.12.82",
2728
"phpmd/phpmd": "^2.9",
2829
"vimeo/psalm": "^4.6",
2930
"squizlabs/php_codesniffer": "^3.5",
30-
"mockery/mockery": "^1.4"
31+
"mockery/mockery": "^1.4",
32+
"ext-curl": "*"
3133
},
3234
"autoload": {
3335
"psr-4": {

composer.lock

Lines changed: 94 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/arangodb-client.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ $arangoClient = new ArangoClient($config);
66
## Configuration
77
Upon creation, you can alter the default configuration of the client. The following options are available:
88
* endpoint = 'http://localhost:8529'
9+
* connection = 'Keep-Alive'
10+
* version = 1.1
911
* host = null
1012
* port = null
1113
* username = null
1214
* password = null
1315
* database = '_system'
14-
* connection = 'Keep-Alive'
1516

1617
```
1718
$config = [
@@ -26,8 +27,9 @@ $arangoClient = new ArangoClient($config);
2627

2728
### Support Guzzle configuration
2829
In addition to the above mentioned options you can use the following Guzzle 7 specific options:
29-
* allow_redirects
30-
* connect_timeout
30+
* [version](https://docs.guzzlephp.org/en/stable/request-options.html#version)
31+
* [allow_redirects](https://docs.guzzlephp.org/en/stable/request-options.html#allow-redirects)
32+
* [connect_timeout](https://docs.guzzlephp.org/en/stable/request-options.html#connect-timeout)
3133

3234
### Endpoint vs host/port
3335
Some common packages and frameworks work with a host/port combination by default.

docs/schema-collections.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ Get the properties of the requested collection.
2828
$arangoClient->schema()->getCollectionWithDocumentCount('_fishbowl');
2929
```
3030

31+
### getCollectionDocumentCount(string $collection): int
32+
Get the number of documents within the requested collection.
33+
```
34+
$arangoClient->schema()->getCollectionDocumentCount('users');
35+
```
36+
3137
### getCollectionStatistics(string $collection, bool $details = false): array
3238
Get the properties of the requested collection.
3339
```
@@ -58,6 +64,12 @@ Rename a collection
5864
$arangoClient->schema()->renameCollection('users', 'characters');
5965
```
6066

67+
### truncateCollection(string $name): bool
68+
Truncate a collection.
69+
```
70+
$arangoClient->schema()->truncateCollection('teams');
71+
```
72+
6173
### deleteCollection(string $name): bool
6274
Delete a collection
6375
```

phpunit.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
</include>
1717
</coverage>
1818
<php>
19+
<env name="ARANGODB_VERSION" value="3.7"/>
1920
</php>
2021
</phpunit>

0 commit comments

Comments
 (0)