-
Notifications
You must be signed in to change notification settings - Fork 521
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
This reverts commit cb53a35.
- Loading branch information
1 parent
6f44856
commit bc6b453
Showing
11 changed files
with
79 additions
and
107 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
src/Microsoft.Health.Fhir.SqlServer/Features/Search/ISqlQueryHashCalculator.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,17 @@ | ||
// ------------------------------------------------------------------------------------------------- | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. | ||
// ------------------------------------------------------------------------------------------------- | ||
|
||
namespace Microsoft.Health.Fhir.SqlServer.Features.Search | ||
{ | ||
public interface ISqlQueryHashCalculator | ||
{ | ||
/// <summary> | ||
/// Given a string that represents a SQL query, this returns the calculated hash of that query. | ||
/// </summary> | ||
/// <param name="query">The SQL query as text</param> | ||
/// <returns>A string hash value.</returns> | ||
string CalculateHash(string query); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/Microsoft.Health.Fhir.SqlServer/Features/Search/SqlQueryHashCalculator.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,17 @@ | ||
// ------------------------------------------------------------------------------------------------- | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. | ||
// ------------------------------------------------------------------------------------------------- | ||
|
||
using Microsoft.Health.Core.Extensions; | ||
|
||
namespace Microsoft.Health.Fhir.SqlServer.Features.Search | ||
{ | ||
internal class SqlQueryHashCalculator : ISqlQueryHashCalculator | ||
{ | ||
public string CalculateHash(string query) | ||
{ | ||
return query.ComputeHash(); | ||
} | ||
} | ||
} |
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
59 changes: 0 additions & 59 deletions
59
test/Microsoft.Health.Fhir.Shared.Tests.Integration/Helpers/ReadableLogger.cs
This file was deleted.
Oops, something went wrong.
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
25 changes: 25 additions & 0 deletions
25
test/Microsoft.Health.Fhir.Shared.Tests.Integration/Persistence/TestSqlHashCalculator.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,25 @@ | ||
// ------------------------------------------------------------------------------------------------- | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. | ||
// ------------------------------------------------------------------------------------------------- | ||
|
||
using Microsoft.Health.Core.Extensions; | ||
using Microsoft.Health.Fhir.SqlServer.Features.Search; | ||
|
||
namespace Microsoft.Health.Fhir.Tests.Integration.Persistence | ||
{ | ||
public class TestSqlHashCalculator : ISqlQueryHashCalculator | ||
{ | ||
public string MostRecentSqlQuery { get; set; } | ||
|
||
public string MostRecentSqlHash { get; set; } | ||
|
||
public string CalculateHash(string query) | ||
{ | ||
MostRecentSqlQuery = query; | ||
MostRecentSqlHash = query.ComputeHash(); | ||
|
||
return MostRecentSqlHash; | ||
} | ||
} | ||
} |