mirror of
https://github.com/grafana/grafana.git
synced 2025-09-23 18:52:33 +08:00
Postgres: Return tables with hyphenated schemes (#45754)
* add basic test for buildSchemaConstraint function * wrap table schema in quote_ident function * fix type error in meta_query.test * swap test for inline comment * make comment more readable
This commit is contained in:
@ -74,8 +74,9 @@ LIMIT 1
|
|||||||
}
|
}
|
||||||
|
|
||||||
buildSchemaConstraint() {
|
buildSchemaConstraint() {
|
||||||
|
// quote_ident protects hyphenated schemes
|
||||||
const query = `
|
const query = `
|
||||||
table_schema IN (
|
quote_ident(table_schema) IN (
|
||||||
SELECT
|
SELECT
|
||||||
CASE WHEN trim(s[i]) = '"$user"' THEN user ELSE trim(s[i]) END
|
CASE WHEN trim(s[i]) = '"$user"' THEN user ELSE trim(s[i]) END
|
||||||
FROM
|
FROM
|
||||||
|
Reference in New Issue
Block a user