JSFiddle - React, Tailwind, and code Playground

by bilbobaggins

JavaScript

var re=`WITH RECURSIVE t AS (
   SELECT min(${tunnel.tempDep.searchkey}) AS 
   ${tunnel.tempDep.searchkey} FROM employees
   UNION ALL
   SELECT (SELECT min(
   ${tunnel.tempDep.searchkey}) FROM ${tunnel.mod.Name} WHERE ${tunnel.tempDep.searchkey} > t.${tunnel.tempDep.searchkey})
   FROM t WHERE t.${tunnel.tempDep.searchkey} IS NOT NULL
   )
SELECT ${tunnel.tempDep.searchkey} FROM t WHERE ${tunnel.tempDep.searchkey} IS NOT NULL and lower(${tunnel.tempDep.selector}) like '${tunnel.tempDep.colmetafilter}%';
`


var r=
      'select  b.' +
      tunnel.tempDep.searchkey + ' from  (' +
      'select a.' +
      tunnel.tempDep.searchkey + ' from "' +
      tunnel.mod.Name +
      '" as a where  ' +
      tunnel.tempDep.selector +
      ' ' +
      tunnel.tempDep.colmetafilter +
      'limit 20) b' +
      ' group by ' +
      tunnel.tempDep.searchkey