Skip to content

Commit

Permalink
Fix: Go Expression Fix Snowflake-Labs#1384
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisIsidora committed Dec 7, 2022
1 parent ddd00c5 commit b164fb6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/snowflake/table_constraint.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion pkg/snowflake/tag_association.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b164fb6

Please sign in to comment.