/// <summary>
 /// Get the table name for a selected column.
 /// </summary>
 /// <param name="i"></param>
 /// <returns>string the table name</returns>
 public string GetTableName(int i)
 {
     WaitIfConnectingAsync().Wait();
     ThrowIfAny();
     try
     {
         return(_worker.GetTableName(i));
     }
     catch (Exception e)
     {
         throw new SQLiteServerException(e.Message);
     }
 }
示例#2
0
        /// <summary>
        /// Create a row header given the reader.
        /// Header data is data that can be used before we call Read
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="guid">The command Guid</param>
        /// <returns></returns>
        private static RowHeader BuildRowHeader(ISQLiteServerDataReaderWorker reader, string guid)
        {
            var header = new RowHeader
            {
                TableNames = new List <string>(),
                Names      = new List <string>(),
                Types      = new List <int>(),
                HasRows    = reader.HasRows,
                Guid       = guid
            };

            // get the headers.
            for (var i = 0; i < reader.FieldCount; ++i)
            {
                header.Names.Add(reader.GetName(i));
                header.TableNames.Add(reader.GetTableName(i));
                header.Types.Add((int)Field.TypeToFieldType(reader.GetFieldType(i)));
            }

            return(header);
        }