@opengis/fastify-table 1.2.9 → 1.2.10

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "1.2.9",
3
+ "version": "1.2.10",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [
@@ -23,16 +23,16 @@ async function autoIndex({
23
23
  const redisKey = `autoindex1:${table}:${attrs.join(';')}`;
24
24
  const tableList = getTable({ table });
25
25
  const existsCache = loadedIndex[redisKey];
26
- if (existsCache) { return 'ok'; }
26
+ if (existsCache && !config.disableCache) { return 'ok'; }
27
27
 
28
28
  const tbs = tableList[0];
29
29
  const [ns, tbl] = tableList[0].split('.');
30
30
  const { rows: index } = await pg.query(`select * from pg_indexes where tablename = '${tbl}' and schemaname = '${ns}'`);
31
31
 
32
- if (existsCache && index?.length > 0) { return null; }
32
+ if (existsCache && !config.disableCache && index?.length > 0) { return null; }
33
33
  // console.log('autoindex', table, filter?.map((el) => el.name || el));
34
34
  const { rows: cols } = await pg.query(`SELECT attrelid::regclass AS tbl, attname AS aname, atttypid::regtype AS datatype, atttypid
35
- FROM pg_attribute WHERE attrelid = '${tbs}'::regclass and attname = any('{ ${attrs} }')`);
35
+ FROM pg_attribute WHERE attrelid = '${tbs}'::regclass and attname = any('{ ${attrs} }')`);
36
36
 
37
37
  const qIndex = [];
38
38
  const indexAr = {};