-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #143 from RevealBi/data-source/ms-azure-sql
MS Azure Sql Data Source
- Loading branch information
Showing
7 changed files
with
208 additions
and
21 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
e2e/Sandbox/DashboardCreators/MSAzureSqlServerDSDashboard.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using Reveal.Sdk.Dom; | ||
using Reveal.Sdk.Dom.Data; | ||
using Reveal.Sdk.Dom.Visualizations; | ||
using System.Collections.Generic; | ||
|
||
namespace Sandbox.DashboardFactories | ||
{ | ||
internal class MSAzureSqlServerDSDashboard : IDashboardCreator | ||
{ | ||
public string Name => "MS Azure Sql Server"; | ||
|
||
public RdashDocument CreateDashboard() | ||
{ | ||
var document = new RdashDocument("MS Azure Sql Dashboard"); | ||
|
||
var msAzureSqlDS = new MicrosoftAzureSqlServerDataSource() | ||
{ | ||
Id = "MSAzureSqlId", | ||
Title = "Microsoft Azure Sql Server Data Source", | ||
Subtitle = "MS Azure Sql Server DS Subtitle", | ||
Database = "reveal", | ||
DefaultRefreshRate = "180", | ||
Encrypt = false, | ||
Host = "revealtesting.database.windows.net", | ||
Port = 1433, | ||
TrustServerCertificate = false | ||
}; | ||
|
||
var msAzureSqlDSItem = new MicrosoftAzureSqlServerDataSourceItem("Microsoft Azure Sql Data Source Item", msAzureSqlDS) | ||
{ | ||
Id = "MSAzureSqlItemId", | ||
Title = "Microsoft Azure Sql Server Data Source Item", | ||
Subtitle = "MS Azure Sql Server DSI Subtitle", | ||
Table = "Customers", | ||
Fields = new List<IField>() | ||
{ | ||
new TextField("City"), | ||
new TextField("CustomerID"), | ||
} | ||
}; | ||
|
||
document.Visualizations.Add(new GridVisualization("Customers in France", msAzureSqlDSItem) | ||
.SetColumns("CustomerID", "City")); | ||
|
||
return document; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 14 additions & 1 deletion
15
src/Reveal.Sdk.Dom/Data/DataSourceItems/MicrosoftAzureSqlServerDataSourceItem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
namespace Reveal.Sdk.Dom.Data | ||
{ | ||
internal class MicrosoftAzureSqlServerDataSourceItem : MicrosoftSqlServerDataSourceItem | ||
public class MicrosoftAzureSqlServerDataSourceItem : MicrosoftSqlServerDataSourceItem | ||
{ | ||
public MicrosoftAzureSqlServerDataSourceItem(string title, DataSource dataSource) : | ||
base(title, dataSource) | ||
{ } | ||
|
||
public MicrosoftAzureSqlServerDataSourceItem(string title, MicrosoftAzureSqlServerDataSource dataSource) : | ||
base(title, dataSource) | ||
{ } | ||
|
||
public MicrosoftAzureSqlServerDataSourceItem(string title) : | ||
base(title, new MicrosoftAzureSqlServerDataSource()) | ||
{ } | ||
|
||
protected override DataSource CreateDataSourceInstance(DataSource dataSource) | ||
{ | ||
return Create<MicrosoftAzureSqlServerDataSource>(dataSource); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters