mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 03:16:01 +00:00
show table row count for MySQL
This commit is contained in:
@@ -88,6 +88,7 @@ class Analyser extends DatabaseAnalyser {
|
||||
columns: columns.rows.filter(col => col.pureName == table.pureName).map(getColumnInfo),
|
||||
primaryKey: DatabaseAnalyser.extractPrimaryKeys(table, pkColumns.rows),
|
||||
foreignKeys: DatabaseAnalyser.extractForeignKeys(table, fkColumns.rows),
|
||||
tableRowCount: table.tableRowCount,
|
||||
indexes: _.uniqBy(
|
||||
indexes.rows.filter(
|
||||
idx =>
|
||||
@@ -163,6 +164,7 @@ class Analyser extends DatabaseAnalyser {
|
||||
...x,
|
||||
objectId: x.pureName,
|
||||
contentHash: _.isDate(x.modifyDate) ? x.modifyDate.toISOString() : x.modifyDate,
|
||||
tableRowCount: x.tableRowCount,
|
||||
})),
|
||||
views: tableModificationsQueryData.rows
|
||||
.filter(x => x.objectType == 'VIEW')
|
||||
|
||||
@@ -2,6 +2,7 @@ module.exports = `
|
||||
select
|
||||
TABLE_NAME as pureName,
|
||||
TABLE_TYPE as objectType,
|
||||
TABLE_ROWS as tableRowCount,
|
||||
case when ENGINE='InnoDB' then CREATE_TIME else coalesce(UPDATE_TIME, CREATE_TIME) end as modifyDate
|
||||
from information_schema.tables
|
||||
where TABLE_SCHEMA = '#DATABASE#'
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
module.exports = `
|
||||
select
|
||||
TABLE_NAME as pureName,
|
||||
TABLE_ROWS as tableRowCount,
|
||||
case when ENGINE='InnoDB' then CREATE_TIME else coalesce(UPDATE_TIME, CREATE_TIME) end as modifyDate
|
||||
from information_schema.tables
|
||||
where TABLE_SCHEMA = '#DATABASE#' and TABLE_TYPE='BASE TABLE' and TABLE_NAME =OBJECT_ID_CONDITION;
|
||||
|
||||
Reference in New Issue
Block a user