From b164fb65072ba404d693d53721f8ac3c63a49684 Mon Sep 17 00:00:00 2001 From: ChrisIsidora <7924584+ChrisIsidora@users.noreply.github.com> Date: Wed, 7 Dec 2022 20:51:48 +0100 Subject: [PATCH] Fix: Go Expression Fix #1384 --- pkg/snowflake/table_constraint.go | 3 ++- pkg/snowflake/tag_association.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/snowflake/table_constraint.go b/pkg/snowflake/table_constraint.go index 9f0c0c736c..6fcae4eb88 100644 --- a/pkg/snowflake/table_constraint.go +++ b/pkg/snowflake/table_constraint.go @@ -221,7 +221,8 @@ type tableConstraint struct { // Show returns the SQL query that will show a table constraint by ID. func ShowTableConstraint(name, tableDB, tableSchema, tableName string, db *sql.DB) (*tableConstraint, error) { - rows, err := db.Query(`SELECT * FROM SNOWFLAKE.INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE TABLE_NAME = '?' AND TABLE_SCHEMA = '?' AND TABLE_CATALOG = '?' AND CONSTRAINT_NAME = '?'`, + stmt := `SELECT * FROM SNOWFLAKE.INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE TABLE_NAME = '?' AND TABLE_SCHEMA = '?' AND TABLE_CATALOG = '?' AND CONSTRAINT_NAME = '?'` + rows, err := db.Query(stmt, tableName, tableSchema, tableDB, name) if err != nil { return nil, err diff --git a/pkg/snowflake/tag_association.go b/pkg/snowflake/tag_association.go index 87b819dc7d..4b9d24351f 100644 --- a/pkg/snowflake/tag_association.go +++ b/pkg/snowflake/tag_association.go @@ -96,7 +96,8 @@ func ScanTagAssociation(row *sqlx.Row) (*tagAssociation, error) { } func ListTagAssociations(tb *TagAssociationBuilder, db *sql.DB) ([]tagAssociation, error) { - rows, err := db.Query(`SELECT SYSTEM$GET_TAG('"?"."?"."?"', '?', '?') TAG_VALUE WHERE TAG_VALUE IS NOT NULL`, + stmt := `SELECT SYSTEM$GET_TAG('"?"."?"."?"', '?', '?') TAG_VALUE WHERE TAG_VALUE IS NOT NULL` + rows, err := db.Query(stmt, tb.databaseName, tb.schemaName, tb.tagName, tb.objectIdentifier, tb.objectType) if err != nil { return nil, err