'sql' => "SELECT * FROM host_info WHERE 0=1"
." OR (key LIKE '%.exit_code' AND val<> '0')"
,
- ]
+ ],
+ 'host_git' => [
+ 'sql' => "SELECT host"
+ .",max(updated) as last_updated"
+ .",min(updated) as first_updated"
+ .",(SELECT count(val) FROM host_info path WHERE path.host=hi.host AND path.key LIKE '%.path') as repos"
+ .",max((SELECT DISTINCT val FROM host_info ex WHERE ex.host=hi.host AND ex.key LIKE '%.exit_code')) as exit"
+ ." FROM host_info hi"
+ ." GROUP BY host ORDER BY host"
+ ,
+ 'row_parse_pre' => function(&$row) {
+ foreach ($row as $k=>$v) {
+ if (strpos($k,'updated') !== false) {
+ $row[$k] = preg_replace('/\..*$/','',$v);
+ }
+ }
+ },
+ ],
],
];
+#bye($DBQ['data']['tables']['host_git']['sql']);
?>