mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-16 05:53:03 +03:00
update db init
This commit is contained in:
@@ -173,6 +173,16 @@ namespace Emby.Server.Implementations.Data
|
||||
return result[index].ReadGuid();
|
||||
}
|
||||
|
||||
private static void CheckName(string name)
|
||||
{
|
||||
#if DEBUG
|
||||
//if (!name.IndexOf("@", StringComparison.OrdinalIgnoreCase) != 0)
|
||||
{
|
||||
throw new Exception("Invalid param name: " + name);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void TryBind(this IStatement statement, string name, double value)
|
||||
{
|
||||
IBindParameter bindParam;
|
||||
@@ -180,6 +190,10 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
bindParam.Bind(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
CheckName(name);
|
||||
}
|
||||
}
|
||||
|
||||
public static void TryBind(this IStatement statement, string name, string value)
|
||||
@@ -187,7 +201,18 @@ namespace Emby.Server.Implementations.Data
|
||||
IBindParameter bindParam;
|
||||
if (statement.BindParameters.TryGetValue(name, out bindParam))
|
||||
{
|
||||
bindParam.Bind(value);
|
||||
if (value == null)
|
||||
{
|
||||
bindParam.BindNull();
|
||||
}
|
||||
else
|
||||
{
|
||||
bindParam.Bind(value);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CheckName(name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,6 +223,10 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
bindParam.Bind(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
CheckName(name);
|
||||
}
|
||||
}
|
||||
|
||||
public static void TryBind(this IStatement statement, string name, float value)
|
||||
@@ -207,6 +236,10 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
bindParam.Bind(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
CheckName(name);
|
||||
}
|
||||
}
|
||||
|
||||
public static void TryBind(this IStatement statement, string name, int value)
|
||||
@@ -216,6 +249,10 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
bindParam.Bind(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
CheckName(name);
|
||||
}
|
||||
}
|
||||
|
||||
public static void TryBind(this IStatement statement, string name, Guid value)
|
||||
@@ -225,6 +262,10 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
bindParam.Bind(value.ToGuidParamValue());
|
||||
}
|
||||
else
|
||||
{
|
||||
CheckName(name);
|
||||
}
|
||||
}
|
||||
|
||||
public static void TryBind(this IStatement statement, string name, DateTime value)
|
||||
@@ -234,6 +275,10 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
bindParam.Bind(value.ToDateTimeParamValue());
|
||||
}
|
||||
else
|
||||
{
|
||||
CheckName(name);
|
||||
}
|
||||
}
|
||||
|
||||
public static void TryBind(this IStatement statement, string name, long value)
|
||||
@@ -243,6 +288,10 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
bindParam.Bind(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
CheckName(name);
|
||||
}
|
||||
}
|
||||
|
||||
public static void TryBind(this IStatement statement, string name, byte[] value)
|
||||
@@ -252,6 +301,10 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
bindParam.Bind(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
CheckName(name);
|
||||
}
|
||||
}
|
||||
|
||||
public static void TryBindNull(this IStatement statement, string name)
|
||||
@@ -261,6 +314,10 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
bindParam.BindNull();
|
||||
}
|
||||
else
|
||||
{
|
||||
CheckName(name);
|
||||
}
|
||||
}
|
||||
|
||||
public static void TryBind(this IStatement statement, string name, DateTime? value)
|
||||
|
||||
Reference in New Issue
Block a user