private sqlite3_column_decltype ( |
||
stmt | ||
index | int | |
Результат |
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"; //} } }
internal override string ColumnType(SqliteStatement stmt, int index, out TypeAffinity nAffinity) { var p = UnsafeNativeMethods.sqlite3_column_decltype(stmt._sqlite_stmt, index); nAffinity = ColumnAffinity(stmt, index); if (!string.IsNullOrEmpty(p)) { return(UTF8ToString(p, -1)); } string[] ar = stmt.TypeDefinitions; if (ar != null) { if (index < ar.Length && ar[index] != null) { return(ar[index]); } } return(String.Empty); }
internal override string ColumnType(SqliteStatement stmt, int index, out TypeAffinity nAffinity) { IntPtr p = UnsafeNativeMethods.sqlite3_column_decltype(stmt._sqlite_stmt, index); nAffinity = ColumnAffinity(stmt, index); if (p != IntPtr.Zero) { return(base.ToString(p)); } else { string[] ar = stmt.TypeDefinitions; if (ar != null) { if (index < ar.Length) { return(ar[index]); } } switch (nAffinity) { case TypeAffinity.Int64: return("BIGINT"); case TypeAffinity.Double: return("DOUBLE"); case TypeAffinity.Blob: return("BLOB"); default: return("TEXT"); } } }