Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
fix: only fetch active snowflake users (#4916)
Tianzhou (天舟)d674b761b959
diff --git a/backend/plugin/db/snowflake/role.go b/backend/plugin/db/snowflake/role.goindex 64b7dc88cc..c1d711451f 100644--- a/backend/plugin/db/snowflake/role.go+++ b/backend/plugin/db/snowflake/role.go@@ -64,10 +64,14 @@ func (driver *Driver) getInstanceRoles(ctx context.Context) ([]*storepb.Instance}// Query user info+ // The same user could have multiple entires in the usage if it's been deleted and recreated,+ // so we need to use DELETED_ON IS NULL to retrieve the active user.userQuery := `SELECTnameFROM SNOWFLAKE.ACCOUNT_USAGE.USERS+ WHERE DELETED_ON IS NULL+ ORDER BY name ASC`var instanceRoles []*storepb.InstanceRoleMetadatarows, err := driver.db.QueryContext(ctx, userQuery)