aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Emby.Server.Implementations/Data/SqliteExtensions.cs40
1 files changed, 40 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/Data/SqliteExtensions.cs b/Emby.Server.Implementations/Data/SqliteExtensions.cs
index 3dc3cec8e..014211924 100644
--- a/Emby.Server.Implementations/Data/SqliteExtensions.cs
+++ b/Emby.Server.Implementations/Data/SqliteExtensions.cs
@@ -137,5 +137,45 @@ namespace Emby.Server.Implementations.Data
db.Execute(commandText, paramList.ToArray());
}
+
+ public static bool IsDBNull(this IReadOnlyList<IResultSetValue> result, int index)
+ {
+ return result[index].SQLiteType == SQLiteType.Null;
+ }
+
+ public static string GetString(this IReadOnlyList<IResultSetValue> result, int index)
+ {
+ return result[index].ToString();
+ }
+
+ public static bool GetBoolean(this IReadOnlyList<IResultSetValue> result, int index)
+ {
+ return result[index].ToBool();
+ }
+
+ public static int GetInt32(this IReadOnlyList<IResultSetValue> result, int index)
+ {
+ return result[index].ToInt();
+ }
+
+ public static long GetInt64(this IReadOnlyList<IResultSetValue> result, int index)
+ {
+ return result[index].ToInt64();
+ }
+
+ public static float GetFloat(this IReadOnlyList<IResultSetValue> result, int index)
+ {
+ return result[index].ToFloat();
+ }
+
+ public static DateTime GetDateTime(this IReadOnlyList<IResultSetValue> result, int index)
+ {
+ return result[index].ReadDateTime();
+ }
+
+ public static Guid GetGuid(this IReadOnlyList<IResultSetValue> result, int index)
+ {
+ return result[index].ReadGuid();
+ }
}
}