Skip to content

Commit 15f02bf

Browse files
Fix for connection-string issue (#9)
* fix connection-string issue * removing temp files * removing resolver config as it is specific to cosmosDB * updating .gitignore * updating .gitignore
1 parent b651d1b commit 15f02bf

File tree

4 files changed

+30
-27
lines changed

4 files changed

+30
-27
lines changed

Hawaii-Cli/.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,8 @@
1414
*.code-workspace
1515

1616
# Nuget package
17-
/nupkg
17+
/nupkg
18+
19+
#generated json file for testing
20+
*.json
21+

Hawaii-Cli/Classes/CommandLineOptions.cs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,48 +5,48 @@ namespace Hawaii.Cli.Classes
55
{
66
public sealed class CommandLineOptions
77
{
8-
[Option('n', "name", Required = false, HelpText = "file name")]
9-
public String? name { get; set; }
8+
[Option('n', "name", Required = false, HelpText = "Specify the file name, Default value = hawaii-config")]
9+
public string? name { get; set; }
1010

1111
[Option("database-type", Required = false, HelpText = "Type of database to connect")]
12-
public String? databaseType { get; set; }
12+
public string? databaseType { get; set; }
1313

1414
[Option("connection-string", Required = false, HelpText = "Connection details to connect to database")]
15-
public String? connectionString { get; set; }
15+
public string? connectionString { get; set; }
1616

1717
//TODO: Link options with Specidied commands
1818
// we need to make sure certain options are only required with certain commands.
1919
// for example: source is required only with add/update and not init
2020

21-
[Option('s', "source", Required = false, HelpText = "name of the table")]
22-
public String? source { get; set; }
21+
[Option('s', "source", Required = false, HelpText = "Name of the table")]
22+
public string? source { get; set; }
2323

24-
[Option("rest", Required = false, HelpText = "route for rest api")]
25-
public String? restRoute { get; set; }
24+
[Option("rest", Required = false, HelpText = "Route for rest api")]
25+
public string? restRoute { get; set; }
2626

2727
[Option("graphql", Required = false, HelpText = "Type of graphQL")]
28-
public String? graphQLType { get; set; }
28+
public string? graphQLType { get; set; }
2929

30-
[Option("permission", Required = false, HelpText = "permission required to acess source table")]
31-
public String? permission { get; set; }
30+
[Option("permission", Required = false, HelpText = "Permission required to acess source table")]
31+
public string? permission { get; set; }
3232

33-
[Option("fields.include", Required = false, HelpText = "fields that are allowed access to permission")]
34-
public String? fieldsToInclude { get; set; }
33+
[Option("fields.include", Required = false, HelpText = "Fields that are allowed access to permission")]
34+
public string? fieldsToInclude { get; set; }
3535

36-
[Option("fields.exclude", Required = false, HelpText = "fields that are excluded from the action lists")]
37-
public String? fieldsToExclude { get; set; }
36+
[Option("fields.exclude", Required = false, HelpText = "Fields that are excluded from the action lists")]
37+
public string? fieldsToExclude { get; set; }
3838

39-
[Option("relationship", Required = false, HelpText = "specify relationship between two entities")]
40-
public String? relationship { get; set; }
39+
[Option("relationship", Required = false, HelpText = "Specify relationship between two entities")]
40+
public string? relationship { get; set; }
4141

42-
[Option("target.entity", Required = false, HelpText = "specify relationship between two entities")]
43-
public String? targetEntity { get; set; }
42+
[Option("target.entity", Required = false, HelpText = "Specify relationship between two entities")]
43+
public string? targetEntity { get; set; }
4444

45-
[Option("cardinality", Required = false, HelpText = "specify relationship between two entities")]
46-
public String? cardinality { get; set; }
45+
[Option("cardinality", Required = false, HelpText = "Specify cardinality between two entities")]
46+
public string? cardinality { get; set; }
4747

48-
[Option("mapping.fields", Required = false, HelpText = "specify relationship between two entities")]
49-
public String? mappingFields { get; set; }
48+
[Option("mapping.fields", Required = false, HelpText = "Specify fields to be used for mapping the entities")]
49+
public string? mappingFields { get; set; }
5050

5151
[Option(Default = false, HelpText = "Prints all messages to standard output.")]
5252
public bool Verbose { get; set; }

Hawaii-Cli/Classes/ConfigGenerator.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ public static bool GenerateConfig(string fileName, string database_type, string
1010
{
1111

1212
DatabaseType dbType = Enum.Parse<DatabaseType>(database_type);
13-
DataSource dataSource = new DataSource(dbType, connection_string);
13+
DataSource dataSource = new DataSource(dbType);
14+
dataSource.ConnectionString = connection_string;
1415

1516
string file = fileName + ".json";
1617

Hawaii-Cli/Classes/Utils.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.Text.Json.Serialization;
33
using Azure.DataGateway.Config;
44
using Humanizer;
5-
using System.Runtime.Serialization;
65

76
namespace Hawaii.Cli.Classes
87
{
@@ -93,7 +92,6 @@ public static object[] CreateActions(string actions, string? fieldsToInclude, st
9392
action_items = new object[]{Action.GetAction(actions, fieldsToInclude, fieldsToExclude)};
9493
} else {
9594
string[] action_elements = actions.Split(",");
96-
//#action_items should be 1, if either fieldsTOInclude or fieldsToExclude is not null.
9795
if(fieldsToInclude!=null || fieldsToExclude!=null ) {
9896
List<object> action_list = new List<object>();
9997
foreach(string action_element in action_elements) {

0 commit comments

Comments
 (0)