Display materialized views
This commit is contained in:
parent
2721a90455
commit
3af20f9327
@ -27,6 +27,7 @@ type Result struct {
|
||||
type Objects struct {
|
||||
Tables []string `json:"tables"`
|
||||
Views []string `json:"views"`
|
||||
MaterializedViews []string `json:"materialized_views"`
|
||||
Sequences []string `json:"sequences"`
|
||||
}
|
||||
|
||||
@ -117,6 +118,7 @@ func ObjectsFromResult(res *Result) map[string]*Objects {
|
||||
objects[schema] = &Objects{
|
||||
Tables: []string{},
|
||||
Views: []string{},
|
||||
MaterializedViews: []string{},
|
||||
Sequences: []string{},
|
||||
}
|
||||
}
|
||||
@ -126,6 +128,8 @@ func ObjectsFromResult(res *Result) map[string]*Objects {
|
||||
objects[schema].Tables = append(objects[schema].Tables, name)
|
||||
case "view":
|
||||
objects[schema].Views = append(objects[schema].Views, name)
|
||||
case "materialized_view":
|
||||
objects[schema].MaterializedViews = append(objects[schema].MaterializedViews, name)
|
||||
case "sequence":
|
||||
objects[schema].Sequences = append(objects[schema].Sequences, name)
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -130,7 +130,7 @@ FROM
|
||||
LEFT JOIN
|
||||
pg_catalog.pg_namespace n ON n.oid = c.relnamespace
|
||||
WHERE
|
||||
c.relkind IN ('r','v','S','s','') AND
|
||||
c.relkind IN ('r','v','m','S','s','') AND
|
||||
n.nspname !~ '^pg_toast' AND
|
||||
n.nspname NOT IN ('information_schema', 'pg_catalog')
|
||||
ORDER BY 1, 2`
|
||||
|
@ -97,12 +97,14 @@ function buildSchemaSection(name, objects) {
|
||||
var titles = {
|
||||
"tables": "Tables",
|
||||
"views": "Views",
|
||||
"materialized_views": "Materialized Views",
|
||||
"sequences": "Sequences"
|
||||
};
|
||||
|
||||
var icons = {
|
||||
"tables": '<i class="fa fa-table"></i>',
|
||||
"views": '<i class="fa fa-table"></i>',
|
||||
"materialized_views": '<i class="fa fa-table"></i>',
|
||||
"sequences": '<i class="fa fa-circle-o"></i>'
|
||||
};
|
||||
|
||||
@ -113,7 +115,7 @@ function buildSchemaSection(name, objects) {
|
||||
section += "<div class='schema-name'><i class='fa fa-folder-o'></i><i class='fa fa-folder-open-o'></i> " + name + "</div>";
|
||||
section += "<div class='schema-container'>";
|
||||
|
||||
for (group of ["tables", "views", "sequences"]) {
|
||||
for (group of ["tables", "views", "materialized_views", "sequences"]) {
|
||||
if (objects[group].length == 0) continue;
|
||||
|
||||
group_klass = "";
|
||||
|
Loading…
x
Reference in New Issue
Block a user