-
Notifications
You must be signed in to change notification settings - Fork 100
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 #90 from henkmollema/integration-tests
Integration tests - Add integration tests for SQL Server, MySQL and PostgreSQL. - Bumped Dommel package to from .NET 4.5.1 to 4.5.2. - Add non-async `Get` with automatic multi-map. - Resolved several issues with parallel / multi-threaded query execution or use of multiple database systems: - Add `QuoteIdentifier` to `ISqlBuilder` to provide quotes around an identifier such as a column or table name. This deprecates `StartEscapeCharacter` and `EndEscapeCharacter`, which are marked as `[Obsolete]`. - Add a centralized cache for queries and take the database connection type into account when creating a cache key to create unique cache items per database system. - As a result the connection object is passed to several objects such as `SqlExpression<T>` or the table and column name resolvers to provide database-specific behavior.
- Loading branch information
Showing
47 changed files
with
1,436 additions
and
230 deletions.
There are no files selected for viewing
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
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,2 +1,3 @@ | ||
dotnet build | ||
dotnet test test/Dommel.Tests | ||
dotnet test test/Dommel.IntegrationTests |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using System; | ||
using System.Collections.Concurrent; | ||
using System.Data; | ||
using System.Reflection; | ||
|
||
namespace Dommel | ||
{ | ||
public static partial class DommelMapper | ||
{ | ||
internal enum QueryCacheType | ||
{ | ||
Get, | ||
GetByMultipleIds, | ||
GetAll, | ||
Count, | ||
Insert, | ||
Update, | ||
Delete, | ||
DeleteAll, | ||
} | ||
|
||
#pragma warning disable IDE1006 // Naming Styles | ||
internal static ConcurrentDictionary<QueryCacheKey, string> QueryCache = new ConcurrentDictionary<QueryCacheKey, string>(); | ||
internal static ConcurrentDictionary<QueryCacheKey, string> ResolverCache = new ConcurrentDictionary<QueryCacheKey, string>(); | ||
#pragma warning restore IDE1006 // Naming Styles | ||
|
||
internal struct QueryCacheKey : IEquatable<QueryCacheKey> | ||
{ | ||
public QueryCacheKey(QueryCacheType cacheType, IDbConnection connection, MemberInfo memberInfo) | ||
{ | ||
ConnectionType = connection.GetType(); | ||
CacheType = cacheType; | ||
MemberInfo = memberInfo; | ||
} | ||
|
||
#if NETSTANDARD1_3 | ||
public QueryCacheKey(QueryCacheType cacheType, IDbConnection connection, Type type) | ||
{ | ||
ConnectionType = connection.GetType(); | ||
CacheType = cacheType; | ||
MemberInfo = type.GetTypeInfo(); | ||
} | ||
#endif | ||
|
||
public QueryCacheType CacheType { get; } | ||
|
||
public Type ConnectionType { get; } | ||
|
||
public MemberInfo MemberInfo { get; } | ||
|
||
public bool Equals(QueryCacheKey other) => CacheType == other.CacheType && ConnectionType == other.ConnectionType && MemberInfo == other.MemberInfo; | ||
} | ||
} | ||
} |
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
Oops, something went wrong.