Ejemplo n.º 1
0
        public List <ValuePair> getTables()
        {
            DBInterface db;

            db = new PostgreSQLDBInterface(new Settings().warehousedb);

            var pairs = db.getValuePair("id", "value", " select table_name as ID, table_name as Value FROM INFORMATION_SCHEMA.TABLES where table_type = 'BASE TABLE' and table_schema = 'public'");

            var pairs2 = db.getValuePair("viewname", "viewname", "SELECT oid::regclass::text as viewname FROM  pg_class WHERE  relkind = 'm'");

            pairs.AddRange(pairs2);

            return(pairs);
        }
Ejemplo n.º 2
0
        public List <ValuePair> getViewColumns(string tablename)
        {
            DBInterface db;

            db = new PostgreSQLDBInterface(new Settings().warehousedb);
            var pairs = db.getValuePair("attname", "attname", "select a.attname,pg_catalog.format_type(a.atttypid,a.atttypmod), a.attnotnull from pg_attribute a" +
                                        " join pg_class t on a.attrelid = t.oid join pg_namespace s on t.relnamespace = s.oid" +
                                        " where a.attnum > 0 and not a.attisdropped" +
                                        " and t.relname = '" + tablename + "' and s.nspname = 'public'" +
                                        " order by a.attnum; ");



            return(pairs);
        }