mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix datatype query
This commit is contained in:
parent
d8606ddfb0
commit
1dd8192d51
@ -133,14 +133,17 @@ table_schema IN (
|
|||||||
|
|
||||||
buildDatatypeQuery(column: string) {
|
buildDatatypeQuery(column: string) {
|
||||||
let query = `
|
let query = `
|
||||||
SELECT data_type
|
SELECT udt_name
|
||||||
FROM information_schema.columns
|
FROM information_schema.columns
|
||||||
WHERE
|
WHERE
|
||||||
table_schema IN (
|
table_schema IN (
|
||||||
SELECT CASE WHEN trim(unnest) = \'"$user"\' THEN user ELSE trim(unnest) END
|
SELECT schema FROM (
|
||||||
FROM unnest(string_to_array(current_setting(\'search_path\'),\',\'))
|
SELECT CASE WHEN trim(unnest) = \'"$user"\' THEN user ELSE trim(unnest) END as schema
|
||||||
LIMIT 1
|
FROM unnest(string_to_array(current_setting(\'search_path\'),\',\'))
|
||||||
|
) s
|
||||||
|
WHERE EXISTS (SELECT 1 FROM information_schema.schemata WHERE schema_name = s.schema)
|
||||||
)
|
)
|
||||||
|
LIMIT 1
|
||||||
`;
|
`;
|
||||||
query += ' AND table_name = ' + this.quoteIdentAsLiteral(this.target.table);
|
query += ' AND table_name = ' + this.quoteIdentAsLiteral(this.target.table);
|
||||||
query += ' AND column_name = ' + this.quoteIdentAsLiteral(column);
|
query += ' AND column_name = ' + this.quoteIdentAsLiteral(column);
|
||||||
|
Loading…
Reference in New Issue
Block a user