Skip to content

Commit 0a77f98

Browse files
abhishekkumamsseverussundarayush3797Ayush Agarwal
authored
Cherry pick from last release ex version change (#1053)
* Skip generation of multiple config files along with build (#1029) * accepting database type instead of bool * using database type in pipelines * changing leftover param to database type * updating docs * renaming param to generateConfigFile * renaming param to generateConfigFileForDbType * Adding support for nullable/varchar(*) result columns for stored-procedure (#1038) * adding support for nullable result columns * fix formatting * fixing nits * fixing test * Fix broken links (#1046) * Removing references to Cosmos Database in CLI/Engine/Pipelines/Config file names/Build commands. (#1045) * Removing references to Cosmos DatabaseType in CLI/Engine code * updating cosmos commands * updating scripts to use cosmosdb_nosql * updating pipeline files * updating cosmos -> cosmosdb_nosql * Renaming cosmos config file * fix pipeline issue * fix pipeline issue * fix pipeline issue * updating launch settings * debugging error * debugging error * debugging error * debugging error * Updating schema -> graphql-schema for cosmosdb_nosql * Reverting graphql-schema -> schema * Replacing references to cosmos with cosmosdb_nosql Co-authored-by: Ayush Agarwal <[email protected]> * Cli check for stored procedure Operations (#1041) * validation for stored-procedure permission in CLI * fix formatting * fixing tests * fix formatting * fix summary * fixing nits * fix formatting * fix formatting * addressing leftover comments from PR-1045 (#1052) * addressing leftover comments from PR-1045 * updating remaining references to cosmos in readme * updating cosmos getting started doc Co-authored-by: Ayush Agarwal <[email protected]> Co-authored-by: Shyam Sundar J <[email protected]> Co-authored-by: Ayush Agarwal <[email protected]> Co-authored-by: Ayush Agarwal <[email protected]>
1 parent 688a3a1 commit 0a77f98

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+477
-228
lines changed

.pipelines/build-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ steps:
9494
inputs:
9595
command: test
9696
projects: '**/*Tests*.csproj'
97-
arguments: '--filter "TestCategory!=Cosmos&TestCategory!=MsSql&TestCategory!=PostgreSql&TestCategory!=MySql" --configuration $(buildConfiguration) --collect "XPlat Code coverage"'
97+
arguments: '--filter "TestCategory!=CosmosDb_NoSql&TestCategory!=MsSql&TestCategory!=PostgreSql&TestCategory!=MySql" --configuration $(buildConfiguration) --collect "XPlat Code coverage"'
9898

9999
- template: templates/code-signing.yml
100100
parameters:

.pipelines/cosmos-pipelines.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,20 @@ steps:
4646
inputs:
4747
command: build
4848
projects: '**/*.csproj'
49-
arguments: '-p:generateConfigFiles=true --configuration $(buildConfiguration)' # Update this to match your need
49+
arguments: '-p:generateConfigFileForDbType=cosmosdb_nosql --configuration $(buildConfiguration)' # Update this to match your need
5050

5151
52-
displayName: 'Generate dab-config.Cosmos.json'
52+
displayName: 'Generate dab-config.CosmosDb_NoSql.json'
5353
inputs:
5454
folderPath: '$(System.DefaultWorkingDirectory)'
5555
fileType: 'json'
56-
targetFiles: 'src/out/tests/net6.0/dab-config.Cosmos.json'
56+
targetFiles: 'src/out/tests/net6.0/dab-config.CosmosDb_NoSql.json'
5757

5858
- task: DotNetCoreCLI@2
59-
displayName: 'Run Cosmos DB Integration Tests'
59+
displayName: 'Run CosmosDb_NoSql Integration Tests'
6060
inputs:
6161
command: test
62-
arguments: '--filter "TestCategory=Cosmos" --no-build --configuration $(buildConfiguration) $(ADDITIONAL_TEST_ARGS)'
62+
arguments: '--filter "TestCategory=CosmosDb_NoSql" --no-build --configuration $(buildConfiguration) $(ADDITIONAL_TEST_ARGS)'
6363
projects: '**/*Tests/*.csproj'
6464

6565
# '/XPlat Code coverage --results-directory /home/vsts/work/1/s/TestResults/'

.pipelines/mssql-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
inputs:
5050
command: build
5151
projects: '**/*.csproj'
52-
arguments: '-p:generateConfigFiles=true --configuration $(buildConfiguration)' # Update this to match your need
52+
arguments: '-p:generateConfigFileForDbType=mssql --configuration $(buildConfiguration)' # Update this to match your need
5353

5454
5555
displayName: 'Generate dab-config.MsSql.json'
@@ -134,7 +134,7 @@ jobs:
134134
inputs:
135135
command: build
136136
projects: '**/*.csproj'
137-
arguments: '-p:generateConfigFiles=true --configuration $(buildConfiguration)' # Update this to match your need
137+
arguments: '-p:generateConfigFileForDbType=MsSql --configuration $(buildConfiguration)' # Update this to match your need
138138

139139
140140
displayName: 'Generate dab-config.MsSql.json'

.pipelines/mysql-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
inputs:
5454
command: build
5555
projects: '**/*.csproj'
56-
arguments: '-p:generateConfigFiles=true --configuration $(buildConfiguration)' # Update this to match your need
56+
arguments: '-p:generateConfigFileForDbType=mysql --configuration $(buildConfiguration)' # Update this to match your need
5757

5858
5959
displayName: 'Generate dab-config.MySql.json'

.pipelines/pg-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
inputs:
5050
command: build
5151
projects: '**/*.csproj'
52-
arguments: '-p:generateConfigFiles=true --configuration $(buildConfiguration)' # Update this to match your need
52+
arguments: '-p:generateConfigFileForDbType=postgresql --configuration $(buildConfiguration)' # Update this to match your need
5353

5454
5555
displayName: 'Generate dab-config.PostgreSql.json'
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
init --config "dab-config.Cosmos.json" --database-type "cosmos" --connection-string "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==" --cosmosdb_nosql-database "graphqldb" --cosmosdb_nosql-container "planet" --graphql-schema "schema.gql" --host-mode Development --authenticate-devmode-requests false --cors-origin "http://localhost:5000"
2-
add Planet --config "dab-config.Cosmos.json" --source "graphqldb.planet" --permissions "anonymous:create,read,update,delete" --rest false --graphql "Planet:Planets"
3-
update Planet --config "dab-config.Cosmos.json" --permissions "authenticated:create,read,update,delete"
4-
add Character --config "dab-config.Cosmos.json" --source "graphqldb.character" --permissions "authenticated:create,read,update,delete" --rest false --graphql "Character:Characters"
5-
add StarAlias --config "dab-config.Cosmos.json" --source "graphqldb.star" --permissions "anonymous:create,read,update,delete" --rest false --graphql "Star:Stars"
6-
update StarAlias --config "dab-config.Cosmos.json" --source "graphqldb.star" --permissions "authenticated:create,read,update,delete"
1+
init --config "dab-config.CosmosDb_NoSql.json" --database-type "cosmosdb_nosql" --connection-string "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==" --cosmosdb_nosql-database "graphqldb" --cosmosdb_nosql-container "planet" --graphql-schema "schema.gql" --host-mode Development --authenticate-devmode-requests false --cors-origin "http://localhost:5000"
2+
add Planet --config "dab-config.CosmosDb_NoSql.json" --source "graphqldb.planet" --permissions "anonymous:create,read,update,delete" --rest false --graphql "Planet:Planets"
3+
update Planet --config "dab-config.CosmosDb_NoSql.json" --permissions "authenticated:create,read,update,delete"
4+
add Character --config "dab-config.CosmosDb_NoSql.json" --source "graphqldb.character" --permissions "authenticated:create,read,update,delete" --rest false --graphql "Character:Characters"
5+
add StarAlias --config "dab-config.CosmosDb_NoSql.json" --source "graphqldb.star" --permissions "anonymous:create,read,update,delete" --rest false --graphql "Star:Stars"
6+
update StarAlias --config "dab-config.CosmosDb_NoSql.json" --source "graphqldb.star" --permissions "authenticated:create,read,update,delete"

ConfigGenerators/MsSqlCommands.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ add InsertBook --config "dab-config.MsSql.json" --source "insert_book" --source.
3131
add CountBooks --config "dab-config.MsSql.json" --source "count_books" --source.type "stored-procedure" --permissions "anonymous:read" --rest true --graphql true
3232
add DeleteLastInsertedBook --config "dab-config.MsSql.json" --source "delete_last_inserted_book" --source.type "stored-procedure" --permissions "anonymous:delete" --rest true --graphql true
3333
add UpdateBookTitle --config "dab-config.MsSql.json" --source "update_book_title" --source.type "stored-procedure" --source.params "id:1,title:Testing Tonight" --permissions "anonymous:update" --rest true --graphql true
34+
add GetAuthorsHistoryByFirstName --config "dab-config.MsSql.json" --source "get_authors_history_by_first_name" --source.type "stored-procedure" --source.params "firstName:Aaron" --permissions "anonymous:read" --rest true --graphql true
3435
update Publisher --config "dab-config.MsSql.json" --permissions "authenticated:create,read,update,delete" --rest true --graphql true --relationship books --target.entity Book --cardinality many
3536
update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_01:create,delete"
3637
update Publisher --config "dab-config.MsSql.json" --permissions "policy_tester_01:update" --fields.include "*"
@@ -119,3 +120,4 @@ update CountBooks --config "dab-config.MsSql.json" --permissions "authenticated:
119120
update DeleteLastInsertedBook --config "dab-config.MsSql.json" --permissions "authenticated:delete"
120121
update UpdateBookTitle --config "dab-config.MsSql.json" --permissions "authenticated:update"
121122
update Sales --config "dab-config.MsSql.json" --permissions "authenticated:*"
123+
update GetAuthorsHistoryByFirstName --config "dab-config.MsSql.json" --permissions "authenticated:read"

ConfigGenerators/configGenerator.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ $PSDefaultParameterValues['*:Encoding'] = 'utf8';
77
# When invoked without any arguments, config files for all the database types will be generated.
88
$databaseTypes = @();
99
if($args.Count -eq 0){
10-
$databaseTypes = "MsSql", "MySql", "PostgreSql", "Cosmos";
10+
$databaseTypes = "mssql", "mysql", "postgresql", "cosmosdb_nosql";
1111
}
1212
elseif($args.Count -eq 1){
1313
$databaseType = $args[0];
14-
if(-not( ($databaseType -eq "MsSql") -or ($databaseType -eq "MySql") -or ($databaseType -eq "PostgreSql") -or ($databaseType -eq "Cosmos"))){
15-
throw "Valid arguments are MsSql, Mysql, PostgreSql or Cosmos";
14+
if(-not( ($databaseType -eq "mssql") -or ($databaseType -eq "mysql") -or ($databaseType -eq "postgresql") -or ($databaseType -eq "cosmosdb_nosql"))){
15+
throw "Valid arguments are mssql, mysql, postgresql or cosmosdb_nosql";
1616
}
1717
$databaseTypes += $databaseType;
1818
}
@@ -32,21 +32,21 @@ Set-Location $workingDirectory;
3232

3333
#Generates the config files for the selected database types.
3434
foreach($databaseType in $databaseTypes){
35-
if($databaseType -eq "MsSql"){
35+
if($databaseType -eq "mssql"){
3636
$commandFile = "MsSqlCommands.txt";
3737
$configFile = "dab-config.MsSql.json";
3838
}
39-
elseif($databaseType -eq "MySql"){
39+
elseif($databaseType -eq "mysql"){
4040
$commandFile = "MySqlCommands.txt";
4141
$configFile = "dab-config.MySql.json";
4242
}
43-
elseif($databaseType -eq "PostgreSql"){
43+
elseif($databaseType -eq "postgresql"){
4444
$commandFile = "PostgreSqlCommands.txt";
4545
$configFile = "dab-config.PostgreSql.json";
4646
}
4747
else{
4848
$commandFile = "CosmosCommands.txt";
49-
$configFile = "dab-config.Cosmos.json";
49+
$configFile = "dab-config.CosmosDb_NoSql.json";
5050
}
5151

5252
# If a config file with the same name exists, it is deleted to avoid writing to

ConfigGenerators/configGenerator.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ databaseTypes=();
77
# When invoked with a database type, config file for that database type will be generated.
88
# When invoked without any arguments, config files for all the database types will be generated.
99
if [[ $# -eq 0 ]]; then
10-
databaseTypes=("MsSql" "MySql" "PostgreSql" "Cosmos")
10+
databaseTypes=("mssql" "mysql" "postgresql" "cosmosdb_nosql")
1111
elif [[ $# -eq 1 ]]; then
1212
databaseType=$1;
13-
if ! { [ $databaseType == "MsSql" ] || [ $databaseType == "MySql" ] || [ $databaseType == "PostgreSql" ] || [ $databaseType == "Cosmos" ]; }; then
14-
echo "Valid arguments are MsSql, Mysql, PostgreSql or Cosmos";
13+
if ! { [ $databaseType == "mssql" ] || [ $databaseType == "mysql" ] || [ $databaseType == "postgresql" ] || [ $databaseType == "cosmosdb_nosql" ]; }; then
14+
echo "Valid arguments are mssql, mysql, postgresql or cosmosdb_nosql";
1515
exit 1;
1616
fi
1717
databaseTypes+=$databaseType;
@@ -35,18 +35,18 @@ cd $workingDirectory;
3535
#Generates the config files for the selected database types.
3636
for databaseType in ${databaseTypes[@]}
3737
do
38-
if [[ $databaseType == "MsSql" ]]; then
38+
if [[ $databaseType == "mssql" ]]; then
3939
commandFile="MsSqlCommands.txt";
4040
configFile="dab-config.MsSql.json";
41-
elif [[ $databaseType == "MySql" ]]; then
41+
elif [[ $databaseType == "mysql" ]]; then
4242
commandFile="MySqlCommands.txt";
4343
configFile="dab-config.MySql.json";
44-
elif [[ $databaseType == "PostgreSql" ]]; then
44+
elif [[ $databaseType == "postgresql" ]]; then
4545
commandFile="PostgreSqlCommands.txt";
4646
configFile="dab-config.PostgreSql.json";
4747
else
4848
commandFile="CosmosCommands.txt";
49-
configFile="dab-config.Cosmos.json";
49+
configFile="dab-config.CosmosDb_NoSql.json";
5050
fi
5151

5252
# If a config file with the same name exists, it is deleted to avoid writing to

docs/dab-cli.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
The Data API Builder CLI (**dab CLI** or `dab`) is a command line tool that streamlines the local development experience for applications using Data API Builder.
44

5-
- Find the source code here: [Cli](../../src/Cli)
6-
- Getting started: [Getting started](./getting-started-dab-cli.md)
5+
- Find the source code here: [Cli](../src/Cli)
6+
- Getting started: [Getting started](./getting-started/getting-started-dab-cli.md)
77

88
## Key Features of `dab` CLI
99

@@ -18,7 +18,7 @@ The Data API Builder CLI (**dab CLI** or `dab`) is a command line tool that stre
1818
## Contributing to the CLI
1919

2020
Your feedback and contributions are key to its success.
21-
[Build from Source](../../CONTRIBUTING.md)
21+
[Build from Source](../CONTRIBUTING.md)
2222

2323
## CLI command line verbs and options
2424

0 commit comments

Comments
 (0)