Ejemplo n.º 1
0
        // NOTE: this may need work when Vertica is used as master agent
        // currently this is not used by any workflow
        public List <TColumn> GetFieldList(string dbName, string table, string schema)
        {
            var cols = new List <TColumn>();

            using (var con = new VerticaConnection(buildConnString())) {
                con.Open();
                var t = con.GetSchema("Columns", new string[] { dbName, schema, table, null });
                foreach (DataRow row in t.Rows)
                {
                    cols.Add(new TColumn(row.Field <string>("COLUMN_NAME"), false, null, true));
                }
            }
            return(cols);
        }
Ejemplo n.º 2
0
        public IEnumerable <TTable> GetTables(string dbName)
        {
            var tables = new List <TTable>();

            using (var con = new VerticaConnection(buildConnString())) {
                con.Open();
                var t = con.GetSchema("Tables", new string[] { null, null, null, "TABLE" });
                foreach (DataRow row in t.Rows)
                {
                    string tableName = row.Field <string>("TABLE_NAME");
                    // NOTE: interestingly, "TABLE_SCHEM" shall be used instead of "TABLE_SCHEMA"
                    // in case you think this is a typo
                    string schema = row.Field <string>("TABLE_SCHEM");
                    tables.Add(new TTable(tableName, schema));
                }
            }
            return(tables);
        }