[banshee] Extend SqliteConnection to handle double and nullable values.



commit 4596b12b28e0d44554f222cf9ba71b23e9650211
Author: Mike Gemünde <mike gemuende de>
Date:   Sat Apr 3 14:50:32 2010 +0200

    Extend SqliteConnection to handle double and nullable values.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=614734

 .../Hyena/Hyena.Data.Sqlite/SqliteUtils.cs         |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/Libraries/Hyena/Hyena.Data.Sqlite/SqliteUtils.cs b/src/Libraries/Hyena/Hyena.Data.Sqlite/SqliteUtils.cs
index 5095a0d..a2e1e83 100644
--- a/src/Libraries/Hyena/Hyena.Data.Sqlite/SqliteUtils.cs
+++ b/src/Libraries/Hyena/Hyena.Data.Sqlite/SqliteUtils.cs
@@ -43,8 +43,15 @@ namespace Hyena.Data.Sqlite
             } else if (type == typeof (int) || type == typeof (long) || type == typeof (bool)
                 || type == typeof (DateTime) || type == typeof (TimeSpan) || type.IsEnum) {
                 return "INTEGER";
+            } else if (type == typeof (int?) || type == typeof (long?) || type == typeof (bool?)
+                || type == typeof (uint?)) {
+                return "INTEGER NULL";
             } else if (type == typeof (byte[])) {
                 return "BLOB";
+            } else if (type == typeof (double)) {
+                return "REAL";
+             } else if (type == typeof (double?)) {
+                return "REAL NULL";
             } else {
                 throw new Exception (String.Format (
                     "The type {0} cannot be bound to a database column.", type.Name));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]