System.Data.SQLite
Check-in [756bbf5fcb]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add GetObject method to the SQLiteValue class for use in testing and debugging.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sessions
Files: files | file ages | folders
SHA1: 756bbf5fcbef4fd7cec061198f02ee55f0b94eb9
User & Date: mistachkin 2017-10-06 23:07:09
Context
2017-10-06
23:09
Make the IEnumerable<ISQLiteChangeSetMetadataItem> interface part of ISQLiteChangeSet. Add a couple missing null argument checks. check-in: ff0061c1df user: mistachkin tags: sessions
23:07
Add GetObject method to the SQLiteValue class for use in testing and debugging. check-in: 756bbf5fcb user: mistachkin tags: sessions
21:44
Add the SQLiteConnectionLock base class and use it from the classes that need to hold onto a native database connection handle. check-in: 91d210a6ca user: mistachkin tags: sessions
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to System.Data.SQLite/SQLiteModule.cs.

   589    589           public byte[] GetBlob()
   590    590           {
   591    591               if (pValue == IntPtr.Zero) return null;
   592    592   
   593    593               return SQLiteBytes.FromIntPtr(
   594    594                   UnsafeNativeMethods.sqlite3_value_blob(pValue), GetBytes());
   595    595           }
          596  +
          597  +        ///////////////////////////////////////////////////////////////////////
          598  +
          599  +        /// <summary>
          600  +        /// Gets and returns an <see cref="Object" /> instance associated with
          601  +        /// this value.
          602  +        /// </summary>
          603  +        /// <returns>
          604  +        /// The <see cref="Object" /> associated with this value.  If the type
          605  +        /// affinity of the object is unknown or cannot be determined, a null
          606  +        /// value will be returned.
          607  +        /// </returns>
          608  +        public object GetObject()
          609  +        {
          610  +            switch (GetTypeAffinity())
          611  +            {
          612  +                case TypeAffinity.Uninitialized:
          613  +                    {
          614  +                        return null;
          615  +                    }
          616  +                case TypeAffinity.Int64:
          617  +                    {
          618  +                        return GetInt64();
          619  +                    }
          620  +                case TypeAffinity.Double:
          621  +                    {
          622  +                        return GetDouble();
          623  +                    }
          624  +                case TypeAffinity.Text:
          625  +                    {
          626  +                        return GetString();
          627  +                    }
          628  +                case TypeAffinity.Blob:
          629  +                    {
          630  +                        return GetBytes();
          631  +                    }
          632  +                case TypeAffinity.Null:
          633  +                    {
          634  +                        return DBNull.Value;
          635  +                    }
          636  +                default:
          637  +                    {
          638  +                        return null;
          639  +                    }
          640  +            }
          641  +        }
   596    642   
   597    643           ///////////////////////////////////////////////////////////////////////
   598    644   
   599    645           /// <summary>
   600    646           /// Uses the native value handle to obtain and store the managed value
   601    647           /// for this object instance, thus saving it for later use.  The type
   602    648           /// of the managed value is determined by the type affinity of the