Skip to content

Commit 8ee0572

Browse files
authored
Add uninstall command and modify relationship option in cli docs
This PR adds an uninstall command for `dab` to be handily available if developers need to clean and reinstall. Also adds a reminder to the `relationship` option that both source and target entities should already have been added.
1 parent 141bc40 commit 8ee0572

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

docs/getting-started/dab-cli.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ The Data API Builder CLI (**dab CLI** or `dab`) is a command line tool that stre
44

55
- Find the source code here: [Cli](../../src/Cli)
66
- Getting started: [Getting started](./getting-started-dab-cli.md)
7-
- Contribute: [Build from Source](../../src/Cli/CONTRIBUTING.md)
8-
97
## Key Features of `dab` CLI
108

119
- Initialize the configuration file for REST and GraphQL endpoints
@@ -19,5 +17,4 @@ The Data API Builder CLI (**dab CLI** or `dab`) is a command line tool that stre
1917
## Contributing to the CLI
2018

2119
Your feedback and contributions are key to its success.
22-
2320
[Build from Source](../../CONTRIBUTING.md)

docs/getting-started/getting-started-dab-cli.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,19 @@ dab add <entity> --source <source_db> --graphql <graphql_type> --permissions <ro
7171
To update entities which are already added to the config, run the following update command:
7272

7373
```dotnetcli
74-
# dab update book --permissions "authenticate:create" --fields.include "id,title"
74+
# dab update book --permissions "authenticate:create,update" --fields.include "id,title"
7575
7676
dab update <entity> --source <new_source_db> --graphql <new_graphql_type> --permissions <rules:actions> --fields.include <fields_to_include> --fields.exclude <fields_to_exclude>
7777
```
7878

7979
### Add entity relationship mappings
8080

8181
To add relationship mappings between entities, use the following command:
82+
Make sure both the source and target entities have already been added.
83+
84+
```dotnetcli
85+
# dab add author --source dbo.authors --permissions "anonymous:create,read,update"
86+
```
8287

8388
```dotnetcli
8489
# dab update author --relationship books --target.entity book --cardinality many --linking.object dbo.books_authors
@@ -91,7 +96,7 @@ dab update <entity> --relationship <relationship_name> --target.entity <target_e
9196
To add policy details, run the following command:
9297

9398
```dotnetcli
94-
# dab update book --permissions "anonymous:read" --fields.include "*" --policy-database "@claims.id eq @item.id"
99+
# dab update book --permissions "authenticated:update" --fields.include "*" --policy-database "@claims.id eq @item.id"
95100
96101
dab update <entity> --permissions <roles> --fields.include <fields> --policy-database <policy_conditions>
97102
```
@@ -110,3 +115,11 @@ To start the Data API Builder engine, use:
110115
> DAB loads the config in the following order (if not supplied in command-line arguments):
111116
> - `dab-config.{DAB_ENVIRONMENT}.json` : For example, the `dab-config.Development.json` and `dab-config.Production.json` files. The environment version of the file is loaded based on the value set for `DAB_ENVIRONMENT` environment variable.
112117
> - `dab-config.json`
118+
119+
## Uninstall the tool
120+
121+
For some reason, if you need to uninstall `dab` cli, simply do:
122+
123+
```dotnetcli
124+
dotnet tool uninstall -g dab
125+
```

docs/readme.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@
55
- [Getting started](./getting-started/getting-started.md)
66
- [Configuration file](./configuration.md)
77
- [Command Line Interface](./getting-started/dab-cli.md)
8-
- [Running Data API builder for Azure Database](./engine.md)
9-
- [REST features](./rest.md)
8+
- [REST features](./REST.md)
109
- [GraphQL features](./graphql.md)

0 commit comments

Comments
 (0)