Skip to content

Commit 139b4bf

Browse files
updated ReadMe
1 parent b505523 commit 139b4bf

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

Hawaii-Cli/Classes/ConfigGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public static bool GenerateConfig(string fileName, string database_type, string
1414

1515
string file = fileName + ".json";
1616

17-
string schema = Directory.GetCurrentDirectory().Replace("\\", "/") + "/" + file;
17+
string schema = "hawaii.draft-01.schema.json"; //TODO: update it later with correct values
1818

1919

2020
RuntimeConfig runtimeConfig = new RuntimeConfig(schema, dataSource, null, null, null, null, GetDefaultGlobalSettings(), new Dictionary<string, Entity>());

Hawaii-Cli/README.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ hawaii init -name <<filename>> --database_type <<db_type>> --connection_string <
6161
```
6262
**To add entity to the config:**
6363
```
64-
hawaii add <<entity>> -source <<source.DB>> --rest <<rest_route>> --graphql <<graphql_type>> --permissions <<rules:actions>>
64+
hawaii add <<entity>> -source <<source.DB>> --rest <<rest_route>> --graphql <<graphql_type>> --permission <<rules:actions>>
6565
```
6666
**To update entity to the config:**
6767
```
@@ -76,13 +76,33 @@ hawaii init -n todo-001 --database_type "mysql" --connection_string "localhost:8
7676
```
7777
The Generated config will be in the current directory as todo-001.json
7878
```
79-
hawaii add todo --source s001.todo --rest todo --graphql todo --permissions "anonymous:*"
79+
hawaii add todo --source s001.todo --rest todo --graphql todo --permission "anonymous:*"
8080
```
8181
Entity will be added to the config with given rest route, graphql type and prermissions.
8282
```
83-
hawaii update todo --permissions "authenticate:create" --fields.include "id,name,category"
83+
hawaii update todo --permission "authenticate:create" --fields.include "id,name,category"
8484
```
8585
Entity will be updated in the config with the provided changes.
8686

87+
Generate config with some permissions and relationship
88+
```
89+
hawaii init --name todo-005 --database-type mssql --connection-string ""
90+
91+
hawaii add todo --name todo-005 --source s005.todos --permission "authenticated:*"
92+
93+
hawaii add user --name todo-005 --source s005.users --permission "authenticated:*"
94+
95+
hawaii add category --name todo-005 --source s005.categories --permission "authenticated:read"
96+
97+
hawaii update category --name todo-005 --graphql category
8798
99+
hawaii update category --name todo-005 --relationship todos --target.entity todo --cardinality many --mapping.fields "id:category_id"
100+
101+
hawaii update todo --name todo-005 --relationship category --target.entity category --cardinality one --mapping.fields "category_id:id"
102+
103+
hawaii update user --name todo-005 --relationship owns --target.entity todo --cardinality many --mapping.fields "id:owner_id"
104+
105+
hawaii update todo --name todo-005 --relationship owner --target.entity user --cardinality one --mapping.fields "owner_id:id"
106+
107+
```
88108

0 commit comments

Comments
 (0)