8 namespace Fossology\Lib\Proxy;
13 protected $dbViewName;
15 protected $dbViewQuery;
17 protected $materialized =
false;
25 $this->dbViewQuery = $dbViewQuery;
26 $this->dbViewName = $dbViewName;
34 return $this->dbViewName;
42 if ($this->materialized) {
46 $dbManager = $container->get(
'db.manager');
47 $dbManager->queryOnce(
"CREATE TEMPORARY TABLE $this->dbViewName AS $this->dbViewQuery",
"CREATE DbView ".$this->dbViewName);
48 $this->materialized =
true;
56 if (!$this->materialized) {
60 $dbManager = $container->get(
'db.manager');
61 $dbManager->queryOnce(
"DROP TABLE $this->dbViewName",
"DROP DbView ".$this->dbViewName);
62 $this->materialized =
false;
71 return "WITH $this->dbViewName AS (".$this->dbViewQuery.
")";
74 public function getDbViewQuery()
76 return $this->dbViewQuery;
materialize()
create temp table
__construct($dbViewQuery, $dbViewName)
asCTE()
Common Table Expressions.
unmaterialize()
drops temp table