Skip to content

Commit

Permalink
135 support dbtable (#178)
Browse files Browse the repository at this point in the history
* ci:  added drop-all to the test setup

* chore: added missing methods to the docblock for better autocompletion

* fix: fixed confusing functionality for getTables & getAllTables

* fix: Renamed getAllViews to getViews for better Laravel naming compatibility

* fix: Renamed getAllAnalyzers to getAnalyzers for better Laravel naming compatibility

* fix: Renamed getAllGraphs to getGraphs for better Laravel naming compatibility

* docs: streamlined styling and added functions

* test fixed schema method calls

* chore cleared unused function

* test fixed default endpoint

* feat Extended db:show with arangodb functionality

* ci: ensure migrations are converted
  • Loading branch information
LaravelFreelancerNL authored Dec 5, 2024
1 parent 381d12a commit e3594ac
Show file tree
Hide file tree
Showing 20 changed files with 518 additions and 53 deletions.
2 changes: 1 addition & 1 deletion bin/qa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ echo "Run PHPStan"

echo "Test package from within phpunit"
./vendor/bin/testbench convert:migrations
./vendor/bin/testbench migrate:fresh --path=TestSetup/Database/Migrations --path=vendor/orchestra/testbench-core/laravel/migrations/ --realpath --seed
./vendor/bin/testbench migrate:fresh --drop-all --path=TestSetup/Database/Migrations --path=vendor/orchestra/testbench-core/laravel/migrations/ --realpath --seed
./vendor/bin/testbench package:test --coverage --min=80 tests

3 changes: 2 additions & 1 deletion bin/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
printf "\nRun tests\n"
./vendor/bin/testbench migrate:fresh --path=TestSetup/Database/Migrations --path=vendor/orchestra/testbench-core/laravel/migrations/ --realpath --seed
./vendor/bin/testbench convert:migrations
./vendor/bin/testbench migrate:fresh --drop-all --path=TestSetup/Database/Migrations --path=vendor/orchestra/testbench-core/laravel/migrations/ --realpath --seed
./vendor/bin/testbench package:test --coverage --min=80 tests
9 changes: 9 additions & 0 deletions docs/console-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ In addition, you have the option to clear the following in ArangoDB:
* --drop-graphs: drop all named graphs
* --drop-all: drop all of the above: tables, analyzers, views and graphs

## db:show
db:show gives you an overview of the current database and its tables.
In addition to the default Laravel options, you have the following:

* --analyzers: show a list of available analyzers
* --views: show a list of available views
* --graphs: show a list of available named graphs
* --system: include system tables in the table list

## Migrations
_**Migrations for ArangoDB use a different Schema blueprint. Therefore, you either need to run the convert:migrations
command first, or convert them manually**_
Expand Down
15 changes: 10 additions & 5 deletions docs/migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,26 @@ Schema::dropView($viewName);
## Analyzers (ArangoSearch)
You can create, edit or delete an ArangoDB Analyzer.

### New Analyzer
### New analyzer
```php
Schema::createAnalyzer($name, $type, $properties, $features);
```

### Replace Analyzer
### Replace analyzer
```php
Schema::replaceAnalyzer($name, $type, $properties, $features);
```

### Delete Analyzer
### Delete analyzer
```php
Schema::dropAnalyzer($name);
```

### Delete all analyzers
```php
Schema::dropAnalyzers($name);
```

## Named Graphs
Named graphs are predefined managed graphs which feature integrity checks
compared to anonymous graphs.
Expand All @@ -126,7 +131,7 @@ Schema::getGraph($name);

### Get all graphs
```php
Schema::getAllGraphs();
Schema::getGraphs();
```

### Delete a graph
Expand All @@ -141,5 +146,5 @@ Schema::dropGraphIfExists($name);

### Delete all graphs
```php
Schema::dropAllGraphs();
Schema::dropGraphs();
```
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<php>
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
<env name="ARANGODB_VERSION" value="3.12"/>
<env name="DB_ENDPOINT" value="https://localhost:8529"/>
<env name="DB_ENDPOINT" value="http://localhost:8529"/>
<env name="LARAVEL_VERSION" value="11"/>
<env name="RAY_ENABLED" value="(true)"/>
<env name="SEND_CACHE_TO_RAY" value="(false)"/>
Expand Down
Loading

0 comments on commit e3594ac

Please sign in to comment.