@opengis/fastify-table 1.1.143 → 1.1.145

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.1.143",
3
+ "version": "1.1.145",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [
@@ -51,7 +51,7 @@ async function init(client) {
51
51
  const crudInc = table ? await rclient.get(keyCacheTable) || 0 : 0;
52
52
 
53
53
  //
54
- const hash = createHash('sha1').update(query).digest('base64');
54
+ const hash = createHash('sha1').update([query, JSON.stringify(args)].join()).digest('base64');
55
55
  const keyCache = `pg:${hash}:${crudInc}`;
56
56
 
57
57
  const cacheData = await rclient.get(keyCache);
@@ -10,12 +10,12 @@ const sqls = {
10
10
  };
11
11
 
12
12
  export default async function getSelect(name, pg = pgClients.client) {
13
- if (loadCls[name]) return loadCls[name];
13
+ if (loadCls[name] && false) return loadCls[name];
14
14
 
15
15
  const clsDataGIT = await getTemplate(['cls', 'select'], name);
16
16
  const { type } = !clsDataGIT && pg.pk?.['admin.user_cls'] ? await pg.query('select type from admin.user_cls where parent is null and name=$1 union all select type from admin.cls where parent is null and name=$1 limit 1', [name]).then(el => el.rows?.[0] || {}) : {};
17
17
  const q = !clsDataGIT && type && ['sql', 'json'].includes(type) ? sqls[type] : undefined;
18
- const clsDataDB = q ? await pg.query(q, [name]).then(el => el.rows?.[0]?.data) : undefined;
18
+ const clsDataDB = q ? await pg.query(q, [name]).then(el => el.rows?.find(el => el?.data)?.data) : undefined;
19
19
  const clsData = clsDataGIT || clsDataDB;
20
20
  if (!clsData) return null;
21
21