Port 7.7 - WIP

This commit is contained in:
Stephan
2017-08-14 18:21:48 +02:00
parent 1a40dd8d78
commit ab8fc33691
435 changed files with 15298 additions and 5993 deletions

View File

@@ -2,7 +2,7 @@
using System.Data;
using System.Linq;
using Umbraco.Core.Persistence.Querying;
namespace Umbraco.Core.Persistence.SqlSyntax
{
/// <summary>
@@ -21,27 +21,27 @@ namespace Umbraco.Core.Persistence.SqlSyntax
DecimalColumnDefinition = "DECIMAL(38,6)";
TimeColumnDefinition = "TIME"; //SQLSERVER 2008+
BlobColumnDefinition = "VARBINARY(MAX)";
InitColumnTypeMap();
}
public override string RenameTable => "sp_rename '{0}', '{1}'";
public override string AddColumn => "ALTER TABLE {0} ADD {1}";
public override string GetQuotedTableName(string tableName)
{
if (tableName.Contains(".") == false)
return $"[{tableName}]";
var tableNameParts = tableName.Split(new[] { '.' }, 2);
return $"[{tableNameParts[0]}].[{tableNameParts[1]}]";
}
public override string GetQuotedColumnName(string columnName) => $"[{columnName}]";
public override string GetQuotedName(string name) => $"[{name}]";
public override string GetStringColumnEqualComparison(string column, int paramIndex, TextColumnType columnType)
{
switch (columnType)
@@ -55,7 +55,7 @@ namespace Umbraco.Core.Persistence.SqlSyntax
throw new ArgumentOutOfRangeException(nameof(columnType));
}
}
public override string GetStringColumnWildcardComparison(string column, int paramIndex, TextColumnType columnType)
{
switch (columnType)
@@ -69,7 +69,7 @@ namespace Umbraco.Core.Persistence.SqlSyntax
throw new ArgumentOutOfRangeException(nameof(columnType));
}
}
[Obsolete("Use the overload with the parameter index instead")]
public override string GetStringColumnStartsWithComparison(string column, string value, TextColumnType columnType)
{
@@ -84,7 +84,7 @@ namespace Umbraco.Core.Persistence.SqlSyntax
throw new ArgumentOutOfRangeException(nameof(columnType));
}
}
[Obsolete("Use the overload with the parameter index instead")]
public override string GetStringColumnEndsWithComparison(string column, string value, TextColumnType columnType)
{
@@ -99,7 +99,7 @@ namespace Umbraco.Core.Persistence.SqlSyntax
throw new ArgumentOutOfRangeException(nameof(columnType));
}
}
[Obsolete("Use the overload with the parameter index instead")]
public override string GetStringColumnContainsComparison(string column, string value, TextColumnType columnType)
{
@@ -114,7 +114,7 @@ namespace Umbraco.Core.Persistence.SqlSyntax
throw new ArgumentOutOfRangeException(nameof(columnType));
}
}
[Obsolete("Use the overload with the parameter index instead")]
public override string GetStringColumnWildcardComparison(string column, string value, TextColumnType columnType)
{
@@ -129,7 +129,7 @@ namespace Umbraco.Core.Persistence.SqlSyntax
throw new ArgumentOutOfRangeException(nameof(columnType));
}
}
/// <summary>
/// This uses a the DbTypeMap created and custom mapping to resolve the SqlDbType
/// </summary>
@@ -140,7 +140,7 @@ namespace Umbraco.Core.Persistence.SqlSyntax
var dbType = DbTypeMap.ColumnDbTypeMap.First(x => x.Key == clrType).Value;
return GetSqlDbType(dbType);
}
/// <summary>
/// Returns the mapped SqlDbType for the DbType specified
/// </summary>