Exemple #1
0
        public static ColumnRow Load(AdomdDataReader dataReader)
        {
            // Traverse the response and
            // read column 1, "TABLE_SCHEMA"
            // read column 2, "TABLE_NAME"
            // read column 2, "COLUMN_NAME"

            // Get the column value
            string perspectiveName = dataReader.GetString(1);
            string tableName       = dataReader.GetString(2);
            string columnName      = dataReader.GetString(3);

            if (tableName.StartsWith("$") && columnName != "RowNumber")
            {
                // Get the column value
                var row = new ColumnRow();
                row.Name = columnName;

                return(row);
            }
            else
            {
                return(null);
            }
        }
Exemple #2
0
        public static ColumnRow Load(AdomdDataReader dataReader)
        {
            // Traverse the response and
            // read column 1, "TABLE_SCHEMA"
            // read column 2, "TABLE_NAME"
            // read column 2, "COLUMN_NAME"

            // Get the column value
            string perspectiveName = dataReader.GetString(1);
            string tableName = dataReader.GetString(2);
            string columnName = dataReader.GetString(3);
            if (tableName.StartsWith("$") && columnName!="RowNumber")
            {
                // Get the column value
                var row = new ColumnRow();
                row.Name = columnName;

                return row;
            }
            else
                return null;
        }
Exemple #3
0
        internal IEnumerable <ColumnRow> Discover(IEnumerable <IFilter> filters)
        {
            var columns = new List <ColumnRow>();

            Inform("Investigating columns");

            using (var cmd = CreateCommand())
            {
                var adomdFiltering = Build(filters);
                cmd.CommandText = string.Format("select * from $system.dbschema_columns where 1=1{0}", adomdFiltering);
                var rdr = ExecuteReader(cmd);

                while (rdr.Read())
                {
                    var row = ColumnRow.Load(rdr);
                    if (row != null)
                    {
                        columns.Add(row);
                    }
                }
            }

            return(columns);
        }