Exemplo n.º 1
0
        internal override string ColumnType(SqliteStatement stmt, int index, out TypeAffinity nAffinity)
        {
            int len;

#if !SQLITE_STANDARD
            IntPtr p = UnsafeNativeMethods.sqlite3_column_decltype_interop(stmt._sqlite_stmt, index, out len);
#else
            len = -1;
            IntPtr p = UnsafeNativeMethods.sqlite3_column_decltype(stmt._sqlite_stmt, index);
#endif
            nAffinity = ColumnAffinity(stmt, index);

            if (p != IntPtr.Zero)
            {
                return(UTF8ToString(p, len));
            }
            else
            {
                string[] ar = stmt.TypeDefinitions;
                if (ar != null)
                {
                    if (index < ar.Length && ar[index] != null)
                    {
                        return(ar[index]);
                    }
                }
                return(String.Empty);

                //switch (nAffinity)
                //{
                //  case TypeAffinity.Int64:
                //    return "BIGINT";
                //  case TypeAffinity.Double:
                //    return "DOUBLE";
                //  case TypeAffinity.Blob:
                //    return "BLOB";
                //  default:
                //    return "TEXT";
                //}
            }
        }