mirror of
https://github.com/chartdb/chartdb.git
synced 2025-11-08 16:01:57 +00:00
fix(import): strict parse of database metadata (#635)
* fix: strict parst of database metadata * fix: strict parst of database metadata * fix: strict parst of database metadata * fix: strict parst of database metadata * fix: strict parst of database metadata * remove partial * fix: strict parst of database metadata * fix: strict parst of database metadata * fix slqite * udapte mysql + maria * fix: strict parst of database metadata * fix mssql * commit mysql --------- Co-authored-by: johnnyfish <jonathanfishner11@gmail.com>
This commit is contained in:
@@ -84,8 +84,8 @@ export const getMySQLQuery = (
|
||||
',"scale":', IFNULL(cols.numeric_scale, 'null'), '}')
|
||||
ELSE 'null'
|
||||
END,
|
||||
',"ordinal_position":"', cols.ordinal_position,
|
||||
'","nullable":', IF(cols.is_nullable = 'YES', 'true', 'false'),
|
||||
',"ordinal_position":', cols.ordinal_position,
|
||||
',"nullable":', IF(cols.is_nullable = 'YES', 'true', 'false'),
|
||||
',"default":"', IFNULL(REPLACE(REPLACE(cols.column_default, '\\\\', ''), '"', 'ֿֿֿ\\"'), ''),
|
||||
'","collation":"', IFNULL(cols.collation_name, ''), '"}'
|
||||
)))))
|
||||
@@ -98,7 +98,7 @@ export const getMySQLQuery = (
|
||||
AND (0x00) IN (@indexes:=CONCAT_WS(',', @indexes, CONCAT('{"schema":"',indexes.table_schema,
|
||||
'","table":"',indexes.table_name,
|
||||
'","name":"', indexes.index_name,
|
||||
'","size":"',
|
||||
'","size":',
|
||||
(SELECT IFNULL(SUM(stat_value * @@innodb_page_size), -1) AS size_in_bytes
|
||||
FROM mysql.innodb_index_stats
|
||||
WHERE stat_name = 'size'
|
||||
@@ -106,7 +106,7 @@ export const getMySQLQuery = (
|
||||
AND index_name = indexes.index_name
|
||||
AND TABLE_NAME = indexes.table_name
|
||||
AND database_name = indexes.table_schema),
|
||||
'","column":"', indexes.column_name,
|
||||
',"column":"', indexes.column_name,
|
||||
'","index_type":"', LOWER(indexes.index_type),
|
||||
'","cardinality":', indexes.cardinality,
|
||||
',"direction":"', (CASE WHEN indexes.collation = 'D' THEN 'desc' ELSE 'asc' END),
|
||||
@@ -209,8 +209,8 @@ export const getMySQLQuery = (
|
||||
IF(cols.data_type IN ('decimal', 'numeric'),
|
||||
CONCAT('{"precision":', IFNULL(cols.numeric_precision, 'null'),
|
||||
',"scale":', IFNULL(cols.numeric_scale, 'null'), '}'), 'null'),
|
||||
',"ordinal_position":"', cols.ordinal_position,
|
||||
'","nullable":', IF(cols.is_nullable = 'YES', 'true', 'false'),
|
||||
',"ordinal_position":', cols.ordinal_position,
|
||||
',"nullable":', IF(cols.is_nullable = 'YES', 'true', 'false'),
|
||||
',"default":"', IFNULL(REPLACE(REPLACE(cols.column_default, '\\\\', ''), '"', '\\"'), ''),
|
||||
'","collation":"', IFNULL(cols.collation_name, ''), '"}')
|
||||
) FROM (
|
||||
@@ -233,7 +233,7 @@ export const getMySQLQuery = (
|
||||
CONCAT('{"schema":"', cast(idx.table_schema as CHAR),
|
||||
'","table":"', idx.table_name,
|
||||
'","name":"', idx.index_name,
|
||||
'","size":"', IFNULL(
|
||||
'","size":', IFNULL(
|
||||
(SELECT SUM(stat_value * @@innodb_page_size)
|
||||
FROM mysql.innodb_index_stats
|
||||
WHERE stat_name = 'size'
|
||||
@@ -241,7 +241,7 @@ export const getMySQLQuery = (
|
||||
AND index_name = idx.index_name
|
||||
AND TABLE_NAME = idx.table_name
|
||||
AND database_name = idx.table_schema), -1),
|
||||
'","column":"', idx.column_name,
|
||||
',"column":"', idx.column_name,
|
||||
'","index_type":"', LOWER(idx.index_type),
|
||||
'","cardinality":', idx.cardinality,
|
||||
',"direction":"', (CASE WHEN idx.collation = 'D' THEN 'desc' ELSE 'asc' END),
|
||||
|
||||
Reference in New Issue
Block a user