@opengis/fastify-table 2.5.11 → 2.5.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -33,7 +33,7 @@ export default async function getMeta(opt, nocache) {
|
|
|
33
33
|
if (!tlist.includes(tableUnsafe)) {
|
|
34
34
|
throw BadRequestError(`table not found: ${tableOriginal}`);
|
|
35
35
|
}
|
|
36
|
-
const relkinds = tableRows.reduce((acc, curr) => Object.assign(acc, { [curr.name]: curr.relkind }), {});
|
|
36
|
+
const relkinds = tableRows.reduce((acc, curr) => Object.assign(acc, { [curr.name.replace(/"/g, "")]: curr.relkind }), {});
|
|
37
37
|
const fields = await pg
|
|
38
38
|
.query(`select * from ${tableSafe} limit 0`)
|
|
39
39
|
.then((r) => r.fields || []);
|
|
@@ -63,7 +63,7 @@ export default async function getMeta(opt, nocache) {
|
|
|
63
63
|
pk,
|
|
64
64
|
columns: fields,
|
|
65
65
|
geom: geomAttr?.name,
|
|
66
|
-
view: ["v", "m"].includes(relkinds
|
|
66
|
+
view: ["v", "m"].includes(relkinds[tableUnsafe]),
|
|
67
67
|
};
|
|
68
68
|
if (!data[pg.options.database]) {
|
|
69
69
|
data[pg.options.database] = {};
|