@opengis/fastify-table 1.0.92 → 1.0.93

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.
Files changed (53) hide show
  1. package/Changelog.md +281 -277
  2. package/crud/controllers/deleteCrud.js +22 -22
  3. package/crud/controllers/insert.js +58 -58
  4. package/crud/controllers/update.js +61 -61
  5. package/crud/funcs/dataDelete.js +19 -19
  6. package/crud/funcs/dataInsert.js +30 -30
  7. package/crud/funcs/getAccess.js +53 -53
  8. package/crud/funcs/getOpt.js +10 -10
  9. package/crud/funcs/setOpt.js +16 -16
  10. package/crud/funcs/utils/logChanges.js +71 -71
  11. package/crud/index.js +36 -36
  12. package/helper.js +28 -28
  13. package/index.js +97 -97
  14. package/notification/controllers/userNotifications.js +19 -19
  15. package/notification/funcs/addNotification.js +8 -8
  16. package/package.json +26 -26
  17. package/pg/pgClients.js +20 -20
  18. package/policy/funcs/checkPolicy.js +83 -83
  19. package/policy/funcs/sqlInjection.js +33 -33
  20. package/policy/index.js +14 -14
  21. package/redis/client.js +8 -8
  22. package/redis/funcs/redisClients.js +2 -2
  23. package/redis/index.js +19 -19
  24. package/server/migrations/0.sql +78 -78
  25. package/server/templates/form/test.dataset.form.json +411 -411
  26. package/server/templates/table/test.dataset.table.json +28 -28
  27. package/server/templates/table/test.gis.map.table.json +44 -44
  28. package/table/controllers/data.js +103 -103
  29. package/table/controllers/suggest.js +79 -79
  30. package/table/controllers/table.js +52 -52
  31. package/table/controllers/utils/getSelectMeta.js +66 -66
  32. package/table/controllers/utils/getTemplate.js +28 -28
  33. package/table/controllers/utils/gisIRColumn.js +68 -68
  34. package/table/funcs/getFilterSQL/index.js +79 -75
  35. package/table/funcs/getFilterSQL/util/formatValue.js +142 -142
  36. package/table/funcs/getFilterSQL/util/getCustomQuery.js +13 -13
  37. package/table/funcs/getFilterSQL/util/getFilterQuery.js +73 -73
  38. package/table/funcs/getFilterSQL/util/getOptimizedQuery.js +12 -12
  39. package/table/funcs/getFilterSQL/util/getTableSql.js +34 -34
  40. package/table/funcs/metaFormat/getSelectVal.js +20 -20
  41. package/table/funcs/metaFormat/index.js +28 -28
  42. package/test/api/crud.test.js +88 -88
  43. package/test/api/table.test.js +89 -89
  44. package/test/api/widget.test.js +117 -117
  45. package/test/funcs/crud.test.js +122 -122
  46. package/util/controllers/properties.add.js +57 -57
  47. package/util/controllers/status.monitor.js +8 -8
  48. package/widget/controllers/utils/historyFormat.js +76 -76
  49. package/widget/controllers/utils/obj2db.js +13 -13
  50. package/widget/controllers/widget.del.js +44 -44
  51. package/widget/controllers/widget.get.js +98 -98
  52. package/widget/controllers/widget.set.js +76 -76
  53. package/widget/index.js +40 -40
@@ -1,66 +1,66 @@
1
- // import pgClients from '../../../pg/pgClients.js';
2
- import getPG from '../../../pg/funcs/getPG.js';
3
-
4
- import getSelect from './getSelect.js';
5
-
6
- /*
7
- function getTable(table) {
8
- // eslint-disable-next-line class-methods-use-this
9
- const result = table.toLowerCase().replace(/[\n\r]+/g, ' ').split(' from ').filter((el) => /^[a-z0-9_]+\.[a-z0-9_]+/.test(el))
10
- .map((el) => el.split(/[ )]/)[0]);
11
- return result?.pop();
12
- } */
13
-
14
- const selectMeta = {};
15
-
16
- export default async function getSelectMeta({ name, pg: pg1, nocache }) {
17
- if (selectMeta[name] && !nocache) return selectMeta[name];
18
-
19
- const cls = await getSelect(name);
20
-
21
- if (!cls) return null;
22
- if (cls.arr) return cls;
23
- if (!cls.sql) return null;
24
-
25
- const pg = pg1 || getPG({ db: cls.db || 'client' });
26
- const { sql: original } = cls;
27
- const sql = `with c(id,text) as (${original} ) select * from c `;
28
-
29
- /*= == meta table === */
30
- const tableNew = original.toLowerCase().replace(/\n/g, ' ').split(' from ').filter((el) => /^[a-z0-9_]+\.[a-z0-9_]+/.test(el))
31
- .map((el) => el.split(/[ )]/)[0].replace(/[\r\n]+/g, ''));
32
-
33
- const dataOrigin = await pg.query(`${sql} limit 0`);
34
-
35
- const dataOrigin1 = await pg.query(`${original} limit 0`);
36
-
37
- // const table = getTable(original);
38
- const count = cls?.count ?? await pg.query(`select count(*) from (${original})q`).then((el) => el?.rows?.[0].count);
39
-
40
- // column name
41
- const cols = dataOrigin.fields.map((el) => el.name);
42
- const type = dataOrigin.fields.map((el) => pg.pgType?.[el.dataTypeID] || 'text');
43
-
44
- const searchColumn = cls?.searchColumn || (
45
- dataOrigin.fields.find((el) => el.name === 'search') ? 'search' : dataOrigin.fields[1].name);
46
-
47
- const searchQuery = `(${searchColumn.split(',').map((el) => `"${el}" ilike $1 `).join(' or ')})`;
48
-
49
- const data = {
50
-
51
- type: type.join(','),
52
- cols: cols.join(','),
53
- originalCols: dataOrigin1.fields.map((el) => el.name).join(','),
54
- db: cls.db,
55
- original: original?.includes('where') ? `select * from (${sql})q` : sql,
56
- sql,
57
- count,
58
- searchQuery,
59
- table: tableNew.join(','),
60
- time: new Date().toISOString(),
61
-
62
- };
63
-
64
- selectMeta[name] = data;
65
- return data;
66
- }
1
+ // import pgClients from '../../../pg/pgClients.js';
2
+ import getPG from '../../../pg/funcs/getPG.js';
3
+
4
+ import getSelect from './getSelect.js';
5
+
6
+ /*
7
+ function getTable(table) {
8
+ // eslint-disable-next-line class-methods-use-this
9
+ const result = table.toLowerCase().replace(/[\n\r]+/g, ' ').split(' from ').filter((el) => /^[a-z0-9_]+\.[a-z0-9_]+/.test(el))
10
+ .map((el) => el.split(/[ )]/)[0]);
11
+ return result?.pop();
12
+ } */
13
+
14
+ const selectMeta = {};
15
+
16
+ export default async function getSelectMeta({ name, pg: pg1, nocache }) {
17
+ if (selectMeta[name] && !nocache) return selectMeta[name];
18
+
19
+ const cls = await getSelect(name);
20
+
21
+ if (!cls) return null;
22
+ if (cls.arr) return cls;
23
+ if (!cls.sql) return null;
24
+
25
+ const pg = pg1 || getPG({ db: cls.db || 'client' });
26
+ const { sql: original } = cls;
27
+ const sql = `with c(id,text) as (${original} ) select * from c `;
28
+
29
+ /*= == meta table === */
30
+ const tableNew = original.toLowerCase().replace(/\n/g, ' ').split(' from ').filter((el) => /^[a-z0-9_]+\.[a-z0-9_]+/.test(el))
31
+ .map((el) => el.split(/[ )]/)[0].replace(/[\r\n]+/g, ''));
32
+
33
+ const dataOrigin = await pg.query(`${sql} limit 0`);
34
+
35
+ const dataOrigin1 = await pg.query(`${original} limit 0`);
36
+
37
+ // const table = getTable(original);
38
+ const count = cls?.count ?? await pg.query(`select count(*) from (${original})q`).then((el) => el?.rows?.[0].count);
39
+
40
+ // column name
41
+ const cols = dataOrigin.fields.map((el) => el.name);
42
+ const type = dataOrigin.fields.map((el) => pg.pgType?.[el.dataTypeID] || 'text');
43
+
44
+ const searchColumn = cls?.searchColumn || (
45
+ dataOrigin.fields.find((el) => el.name === 'search') ? 'search' : dataOrigin.fields[1].name);
46
+
47
+ const searchQuery = `(${searchColumn.split(',').map((el) => `"${el}" ilike $1 `).join(' or ')})`;
48
+
49
+ const data = {
50
+
51
+ type: type.join(','),
52
+ cols: cols.join(','),
53
+ originalCols: dataOrigin1.fields.map((el) => el.name).join(','),
54
+ db: cls.db,
55
+ original: original?.includes('where') ? `select * from (${sql})q` : sql,
56
+ sql,
57
+ count,
58
+ searchQuery,
59
+ table: tableNew.join(','),
60
+ time: new Date().toISOString(),
61
+
62
+ };
63
+
64
+ selectMeta[name] = data;
65
+ return data;
66
+ }
@@ -1,28 +1,28 @@
1
- import { readFile } from 'fs/promises';
2
- import fs from 'fs';
3
- import path from 'path';
4
- import config from '../../../config.js';
5
-
6
- const loadTemplate = {};
7
-
8
- export default async function getTemplateDir(type, name) {
9
- if (!type) return null;
10
- if (!name) return null;
11
-
12
- const cwd = process.cwd();
13
- const typeDir = path.join(cwd, (config.templateDir || 'server/templates'), type);
14
-
15
- if (!loadTemplate[type]) {
16
- const typeList = fs.existsSync(typeDir) ? fs.readdirSync(typeDir) : [];
17
- loadTemplate[type] = typeList;
18
- }
19
-
20
- const fullname = loadTemplate[type].find((el) => path.parse(el).name === name);
21
- const ext = fullname ? path.extname(fullname)?.slice(1) : null;
22
- if (!ext) return null;
23
-
24
- const sql = loadTemplate[type].includes(`${name}.sql`) ? await readFile(path.join(typeDir, `${name}.sql`), 'utf-8') : null;
25
- const data = loadTemplate[type].includes(`${name}.json`) ? JSON.parse(await readFile(path.join(typeDir, `${name}.json`), 'utf-8')) : await readFile(path.join(typeDir, `${name}.${ext}`), 'utf-8');
26
- if (sql) return { sql };
27
- return data;
28
- }
1
+ import { readFile } from 'fs/promises';
2
+ import fs from 'fs';
3
+ import path from 'path';
4
+ import config from '../../../config.js';
5
+
6
+ const loadTemplate = {};
7
+
8
+ export default async function getTemplateDir(type, name) {
9
+ if (!type) return null;
10
+ if (!name) return null;
11
+
12
+ const cwd = process.cwd();
13
+ const typeDir = path.join(cwd, (config.templateDir || 'server/templates'), type);
14
+
15
+ if (!loadTemplate[type]) {
16
+ const typeList = fs.existsSync(typeDir) ? fs.readdirSync(typeDir) : [];
17
+ loadTemplate[type] = typeList;
18
+ }
19
+
20
+ const fullname = loadTemplate[type].find((el) => path.parse(el).name === name);
21
+ const ext = fullname ? path.extname(fullname)?.slice(1) : null;
22
+ if (!ext) return null;
23
+
24
+ const sql = loadTemplate[type].includes(`${name}.sql`) ? await readFile(path.join(typeDir, `${name}.sql`), 'utf-8') : null;
25
+ const data = loadTemplate[type].includes(`${name}.json`) ? JSON.parse(await readFile(path.join(typeDir, `${name}.json`), 'utf-8')) : await readFile(path.join(typeDir, `${name}.${ext}`), 'utf-8');
26
+ if (sql) return { sql };
27
+ return data;
28
+ }
@@ -1,68 +1,68 @@
1
- import pgClients from '../../../pg/pgClients.js';
2
-
3
- import getTemplate from './getTemplate.js';
4
- import getSelect from './getSelect.js';
5
- import getFilterSQL from '../../funcs/getFilterSQL/index.js';
6
-
7
- export default async function gisIRColumn({
8
- pg = pgClients.client, funcs = {}, layer, column, sql, query = '1=1',
9
- }) {
10
- const time = Date.now();
11
-
12
- const { config = {} } = funcs;
13
-
14
- const sel = await getSelect(query.cls || column);
15
-
16
- const body = await getTemplate('table', layer);
17
- const fData = await getFilterSQL({
18
- table: body?.table || layer, query: body?.query,
19
- });
20
-
21
- const { tlist } = await pg.one(`select array_agg((select nspname from pg_namespace where oid=relnamespace)||'.'||relname) tlist from pg_class
22
- where relkind in ('r','v','m')`);
23
-
24
- const tableName = body?.table || layer;
25
- if (!tlist.includes(body?.table || layer)) return { error: `table not found: ${tableName}`, status: 400 };
26
-
27
- // eslint-disable-next-line max-len
28
- const { fields } = await pg.query(`select * from (${fData?.optimizedSQL || `select * from ${body?.table || layer}`})q limit 0`);
29
-
30
- const col = fields.find((el) => el.name === column);
31
-
32
- if (!col) return { status: 404, message: 'not found' };
33
- const colField = pg.pgType[col.dataTypeID]?.includes('[]') ? `unnest(${column})` : column;
34
-
35
- const q = `select ${colField} as id, count(*)::int from ${tableName} t where ${body?.query || 'true'}
36
- group by ${colField} order by count desc limit 15`;
37
-
38
- if (sql) return q;
39
-
40
- if (!body?.columns?.length) {
41
- const { rows } = await pg.query(q);
42
- if (sel?.arr?.length) {
43
- rows.forEach((el) => {
44
- const data = sel?.find((item) => item.id?.toString() === el.id?.toString());
45
- Object.assign(el, data || {});
46
- });
47
- }
48
- return {
49
- count: rows?.reduce((acc, el) => acc + el.count, 0),
50
- sql: config.local ? q : undefined,
51
- rows,
52
- };
53
- }
54
-
55
- const { rows } = await pg.query(q);
56
- const cls = query.cls || body?.columns?.find((el) => el.name === column)?.data || col.data || col.option;
57
- const select = await getSelect(cls, { val: rows.map((el) => el.id), ar: 1 });
58
- rows.forEach((el) => {
59
- const data = select?.arr ? select.arr?.find((item) => item.id?.toString() === el.id?.toString()) : undefined;
60
- Object.assign(el, data || {});
61
- });
62
- return {
63
- time: Date.now() - time,
64
- count: rows.reduce((acc, el) => acc + el.count, 0),
65
- sql: config.local ? q : undefined,
66
- rows,
67
- };
68
- }
1
+ import pgClients from '../../../pg/pgClients.js';
2
+
3
+ import getTemplate from './getTemplate.js';
4
+ import getSelect from './getSelect.js';
5
+ import getFilterSQL from '../../funcs/getFilterSQL/index.js';
6
+
7
+ export default async function gisIRColumn({
8
+ pg = pgClients.client, funcs = {}, layer, column, sql, query = '1=1',
9
+ }) {
10
+ const time = Date.now();
11
+
12
+ const { config = {} } = funcs;
13
+
14
+ const sel = await getSelect(query.cls || column);
15
+
16
+ const body = await getTemplate('table', layer);
17
+ const fData = await getFilterSQL({
18
+ table: body?.table || layer, query: body?.query,
19
+ });
20
+
21
+ const { tlist } = await pg.one(`select array_agg((select nspname from pg_namespace where oid=relnamespace)||'.'||relname) tlist from pg_class
22
+ where relkind in ('r','v','m')`);
23
+
24
+ const tableName = body?.table || layer;
25
+ if (!tlist.includes(body?.table || layer)) return { error: `table not found: ${tableName}`, status: 400 };
26
+
27
+ // eslint-disable-next-line max-len
28
+ const { fields } = await pg.query(`select * from (${fData?.optimizedSQL || `select * from ${body?.table || layer}`})q limit 0`);
29
+
30
+ const col = fields.find((el) => el.name === column);
31
+
32
+ if (!col) return { status: 404, message: 'not found' };
33
+ const colField = pg.pgType[col.dataTypeID]?.includes('[]') ? `unnest(${column})` : column;
34
+
35
+ const q = `select ${colField} as id, count(*)::int from ${tableName} t where ${body?.query || 'true'}
36
+ group by ${colField} order by count desc limit 15`;
37
+
38
+ if (sql) return q;
39
+
40
+ if (!body?.columns?.length) {
41
+ const { rows } = await pg.query(q);
42
+ if (sel?.arr?.length) {
43
+ rows.forEach((el) => {
44
+ const data = sel?.find((item) => item.id?.toString() === el.id?.toString());
45
+ Object.assign(el, data || {});
46
+ });
47
+ }
48
+ return {
49
+ count: rows?.reduce((acc, el) => acc + el.count, 0),
50
+ sql: config.local ? q : undefined,
51
+ rows,
52
+ };
53
+ }
54
+
55
+ const { rows } = await pg.query(q);
56
+ const cls = query.cls || body?.columns?.find((el) => el.name === column)?.data || col.data || col.option;
57
+ const select = await getSelect(cls, { val: rows.map((el) => el.id), ar: 1 });
58
+ rows.forEach((el) => {
59
+ const data = select?.arr ? select.arr?.find((item) => item.id?.toString() === el.id?.toString()) : undefined;
60
+ Object.assign(el, data || {});
61
+ });
62
+ return {
63
+ time: Date.now() - time,
64
+ count: rows.reduce((acc, el) => acc + el.count, 0),
65
+ sql: config.local ? q : undefined,
66
+ rows,
67
+ };
68
+ }
@@ -1,75 +1,79 @@
1
- /* const getTable = require('../../controllers/utils/getTable');
2
- const pg = require('../../../pg/client');
3
- const config = require('../../../../config'); */
4
-
5
- import getTemplate from '../../controllers/utils/getTemplate.js';
6
- import pgClients from '../../../pg/pgClients.js';
7
- import config from '../../../config.js';
8
- // filter util
9
- import getTableSql from './util/getTableSql.js';
10
- // import getCustomQuery from './util/getCustomQuery.js';
11
- import getFilterQuery from './util/getFilterQuery.js';
12
- import getOptimizedQuery from './util/getOptimizedQuery.js';
13
-
14
- async function getFilterSQL({
15
- table, filter, pg = pgClients.client, search, filterList, query,
16
- }) {
17
- if (!table) return { error: 'param table is required', status: 400 };
18
-
19
- const body = await getTemplate('table', table);
20
-
21
- const fieldQuery = config.allTemplates?.table?.[table] ? `${config.allTemplates?.table?.[table]} limit 0`
22
- : `select * from ${body?.table || table} limit 0`;
23
- const { fields = [] } = await pg.query(fieldQuery);
24
-
25
- const { fields: fieldsModel } = pg.pk[body?.table] ? await pg.query(`select * from ${body.table} limit 0`) : {};
26
-
27
- const autoSearchColumn = fields?.filter((el) => pg.pgType?.[el.dataTypeID] === 'text')?.map((el) => el.name).join(',');
28
- const searchColumn = body?.search_column || autoSearchColumn;
29
- const fieldsList = (fieldsModel || fields)?.map((el) => el.name);
30
- try {
31
- const tableSQL = await getTableSql({
32
- pg, body, table, fields,
33
- });
34
- const sval = `ilike '%${decodeURIComponent(search).replace(/'/g, "''")}%'`;
35
- const searchQuery = search && searchColumn
36
- ? ` (${searchColumn.split(',')?.map((name) => {
37
- const { pk } = tableSQL.find((el) => el.name === name) || {};
38
- return pk && !fieldsList.includes(name) ? `${pk} in (select ${pk} from (${fieldQuery})q where ${name} ${sval})` : `${name} ${sval}`;
39
- }).join(' or ')} )` : '';
40
-
41
- const filters = getFilterQuery({
42
- filter,
43
- tableSQL,
44
- fields,
45
- filterList: filterList || (body?.filter_list || []).concat(body?.filterInline || []).concat(body?.filterCustom || []).concat(body?.filterState || []).concat(body?.filterList || []),
46
- pg,
47
- config,
48
- });
49
-
50
- // filter
51
- const filterQuery = filters?.filter((el) => el.query)?.map((el) => `${el.query} `).join(' and ');
52
- const q = [body?.query, query, searchQuery, filterQuery].filter((el) => el).join(' and ');
53
-
54
- // table
55
- const modelQuery = body?.model || body?.table || table;
56
- const optimizedSQL = `select * from ${getOptimizedQuery({ body, table, q })} `;
57
- const tableCount = getOptimizedQuery({ body, table, q }, true);
58
- // console.log(optimizedSQL);
59
- return {
60
- filterList,
61
-
62
- q,
63
- optimizedSQL,
64
- tableCount,
65
- table: modelQuery,
66
- // filter parts
67
- searchQuery,
68
- };
69
- }
70
- catch (err) {
71
- throw new Error(err.toString());
72
- }
73
- }
74
-
75
- export default getFilterSQL;
1
+ /* const getTable = require('../../controllers/utils/getTable');
2
+ const pg = require('../../../pg/client');
3
+ const config = require('../../../../config'); */
4
+
5
+ import getTemplate from '../../controllers/utils/getTemplate.js';
6
+ import pgClients from '../../../pg/pgClients.js';
7
+ import config from '../../../config.js';
8
+ // filter util
9
+ import getTableSql from './util/getTableSql.js';
10
+ // import getCustomQuery from './util/getCustomQuery.js';
11
+ import getFilterQuery from './util/getFilterQuery.js';
12
+ import getOptimizedQuery from './util/getOptimizedQuery.js';
13
+
14
+ async function getFilterSQL({
15
+ table, filter, pg = pgClients.client, search, filterList, query,
16
+ }) {
17
+ if (!table) return { error: 'param table is required', status: 400 };
18
+
19
+ const body = await getTemplate('table', table);
20
+
21
+ const sqlList = body?.sql?.length
22
+ ? body?.sql?.filter((el) => !el.disabled && el?.sql?.replace)
23
+ .map((el) => ` left join lateral (${el.filter ? el.sql.replace(/limit 1/ig, '') : el.sql}) as ${el.name} on 1=1 `).join(' ')
24
+ : '';
25
+ const fieldQuery = config.allTemplates?.table?.[table] ? `${config.allTemplates?.table?.[table]} limit 0`
26
+ : `select * from ${body?.table || table} ${sqlList ? ` t ${sqlList}` : ''} where 1=1 limit 0`;
27
+ const { fields = [] } = await pg.query(fieldQuery);
28
+
29
+ const { fields: fieldsModel } = pg.pk[body?.table] ? await pg.query(`select * from ${body.table} limit 0`) : {};
30
+
31
+ const autoSearchColumn = fields?.filter((el) => pg.pgType?.[el.dataTypeID] === 'text')?.map((el) => el.name).join(',');
32
+ const searchColumn = body?.search_column || autoSearchColumn;
33
+ const fieldsList = (fieldsModel || fields)?.map((el) => el.name);
34
+ try {
35
+ const tableSQL = await getTableSql({
36
+ pg, body, table, fields,
37
+ });
38
+ const sval = `ilike '%${decodeURIComponent(search).replace(/'/g, "''")}%'`;
39
+ const searchQuery = search && searchColumn
40
+ ? ` (${searchColumn.split(',')?.map((name) => {
41
+ const { pk } = tableSQL.find((el) => el.name === name) || {};
42
+ return pk && !fieldsList.includes(name) ? `${pk} in (select ${pk} from (${fieldQuery})q where ${name} ${sval})` : `${name} ${sval}`;
43
+ }).join(' or ')} )` : '';
44
+
45
+ const filters = getFilterQuery({
46
+ filter,
47
+ tableSQL,
48
+ fields,
49
+ filterList: filterList || (body?.filter_list || []).concat(body?.filterInline || []).concat(body?.filterCustom || []).concat(body?.filterState || []).concat(body?.filterList || []),
50
+ pg,
51
+ config,
52
+ });
53
+
54
+ // filter
55
+ const filterQuery = filters?.filter((el) => el.query)?.map((el) => `${el.query} `).join(' and ');
56
+ const q = [body?.query, query, searchQuery, filterQuery].filter((el) => el).join(' and ');
57
+
58
+ // table
59
+ const modelQuery = body?.model || body?.table || table;
60
+ const optimizedSQL = `select * from ${getOptimizedQuery({ body, table, q })} `;
61
+ const tableCount = getOptimizedQuery({ body, table, q }, true);
62
+ // console.log(optimizedSQL);
63
+ return {
64
+ filterList,
65
+
66
+ q,
67
+ optimizedSQL,
68
+ tableCount,
69
+ table: modelQuery,
70
+ // filter parts
71
+ searchQuery,
72
+ };
73
+ }
74
+ catch (err) {
75
+ throw new Error(err.toString());
76
+ }
77
+ }
78
+
79
+ export default getFilterSQL;