mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 03:45:59 +00:00
clickhouse plugin - initial import
This commit is contained in:
12
plugins/dbgate-plugin-clickhouse/src/backend/sql/columns.js
Normal file
12
plugins/dbgate-plugin-clickhouse/src/backend/sql/columns.js
Normal file
@@ -0,0 +1,12 @@
|
||||
module.exports = `
|
||||
select
|
||||
columns.table as "pureName",
|
||||
tables.uuid as "objectId",
|
||||
columns.name as "columnName",
|
||||
columns.type as "dataType",
|
||||
columns.comment as "columnComment"
|
||||
from system.columns
|
||||
inner join system.tables on columns.table = tables.name and columns.database = tables.database
|
||||
where columns.database='#DATABASE#' and tables.uuid =OBJECT_ID_CONDITION
|
||||
order by toInt32(columns.position)
|
||||
`;
|
||||
@@ -0,0 +1,7 @@
|
||||
const columns = require('./columns');
|
||||
const tables = require('./tables');
|
||||
|
||||
module.exports = {
|
||||
columns,
|
||||
tables,
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
module.exports = `
|
||||
select name as "pureName", metadata_modification_time as "contentHash", total_rows as "tableRowCount", uuid as "objectId", comment as "objectComment",
|
||||
engine as "tableEngine", primary_key as "primaryKeyColumns", sorting_key as "sortingKeyColumns"
|
||||
from system.tables
|
||||
where database='#DATABASE#' and uuid =OBJECT_ID_CONDITION;
|
||||
`;
|
||||
Reference in New Issue
Block a user