1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 07:36:44 +02:00

CockroachDB: Add support via PostgreSQL driver

This fixes cockroachdb/cockroach#40391.
This commit is contained in:
Jakub Vrana
2025-03-08 05:56:49 +01:00
parent ab0f07dd81
commit 4b71549ca0
2 changed files with 8 additions and 2 deletions

View File

@@ -384,13 +384,18 @@ ORDER BY 1";
}
function table_status($name = "") {
global $connection;
static $has_size;
if ($has_size === null) {
$has_size = $connection->result("SELECT 'pg_table_size'::regproc");
}
$return = array();
foreach (
get_rows("SELECT
c.relname AS \"Name\",
CASE c.relkind WHEN 'r' THEN 'table' WHEN 'm' THEN 'materialized view' ELSE 'view' END AS \"Engine\",
CASE c.relkind WHEN 'r' THEN 'table' WHEN 'm' THEN 'materialized view' ELSE 'view' END AS \"Engine\"" . ($has_size ? ",
pg_table_size(c.oid) AS \"Data_length\",
pg_indexes_size(c.oid) AS \"Index_length\",
pg_indexes_size(c.oid) AS \"Index_length\"" : "") . ",
obj_description(c.oid, 'pg_class') AS \"Comment\",
" . (min_version(12) ? "''" : "CASE WHEN c.relhasoids THEN 'oid' ELSE '' END") . " AS \"Oid\",
c.reltuples as \"Rows\",

View File

@@ -1,4 +1,5 @@
Adminer dev:
CockroachDB: Add support via PostgreSQL driver
Adminer 5.0.1 (released 2025-03-07):
Fix bulk operations with tables (regression from 5.0.0)