Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pkg/client/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const (
ObjTypeMaterializedView = "materialized_view"
ObjTypeSequence = "sequence"
ObjTypeFunction = "function"
ObjTypeForeignTable = "foreign_table"
)

type (
Expand Down Expand Up @@ -68,6 +69,7 @@ type (
MaterializedViews []Object `json:"materialized_view"`
Functions []Object `json:"function"`
Sequences []Object `json:"sequence"`
ForeignTables []Object `json:"foreign_table"`
}
)

Expand Down Expand Up @@ -189,6 +191,7 @@ func ObjectsFromResult(res *Result) map[string]*Objects {
MaterializedViews: []Object{},
Functions: []Object{},
Sequences: []Object{},
ForeignTables: []Object{},
}
}

Expand All @@ -205,6 +208,8 @@ func ObjectsFromResult(res *Result) map[string]*Objects {
objects[schema].Functions = append(objects[schema].Functions, obj)
case ObjTypeSequence:
objects[schema].Sequences = append(objects[schema].Sequences, obj)
case ObjTypeForeignTable:
objects[schema].ForeignTables = append(objects[schema].ForeignTables, obj)
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/statements/sql/objects.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ WITH all_objects AS (
LEFT JOIN
pg_catalog.pg_namespace n ON n.oid = c.relnamespace
WHERE
c.relkind IN ('r','v','m','S','s','')
c.relkind IN ('r','v','m','S','s','f','')
AND n.nspname !~ '^pg_(toast|temp)'
AND n.nspname NOT IN ('information_schema', 'pg_catalog')
AND has_schema_privilege(n.nspname, 'USAGE')
Expand Down
7 changes: 5 additions & 2 deletions static/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ function buildSchemaSection(name, objects) {
"table": "Tables",
"view": "Views",
"materialized_view": "Materialized Views",
"foreign_table": "Foreign Tables",
"function": "Functions",
"sequence": "Sequences"
};
Expand All @@ -147,6 +148,7 @@ function buildSchemaSection(name, objects) {
"table": '<i class="fa fa-table"></i>',
"view": '<i class="fa fa-table"></i>',
"materialized_view": '<i class="fa fa-table"></i>',
"foreign_table": '<i class="fa fa-table"></i>',
"function": '<i class="fa fa-bolt"></i>',
"sequence": '<i class="fa fa-circle-o"></i>'
};
Expand All @@ -158,7 +160,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'>";

["table", "view", "materialized_view", "function", "sequence"].forEach(function(group) {
["table", "view", "materialized_view", "foreign_table", "function", "sequence"].forEach(function(group) {
group_klass = "";
if (name == "public" && group == "table") group_klass = "expanded";

Expand Down Expand Up @@ -221,6 +223,7 @@ function loadSchemas() {
table: [],
view: [],
materialized_view: [],
foreign_table: [],
function: [],
sequence: []
}
Expand Down Expand Up @@ -259,7 +262,7 @@ function loadSchemas() {
autocompleteObjects = [];
for (schema in data) {
for (kind in data[schema]) {
if (!(kind == "table" || kind == "view" || kind == "materialized_view" || kind == "function")) {
if (!(kind == "table" || kind == "view" || kind == "materialized_view" || kind == "foreign_table" || kind == "function")) {
continue
}

Expand Down