Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-swinkler committed Apr 1, 2024
1 parent 1cfd2dc commit 8e3aace
Show file tree
Hide file tree
Showing 27 changed files with 28 additions and 37 deletions.
5 changes: 1 addition & 4 deletions pkg/sdk/external_functions_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package sdk
import (
"context"
"database/sql"
"strings"
)

type ExternalFunctions interface {
Expand Down Expand Up @@ -134,9 +133,7 @@ type ExternalFunction struct {
}

func (v *ExternalFunction) ID() SchemaObjectIdentifier {
database := strings.Trim(v.CatalogName, "\"")
schema := strings.Trim(v.SchemaName, "\"")
return NewSchemaObjectIdentifier(database, schema, v.Name)
return NewSchemaObjectIdentifier(v.CatalogName, v.SchemaName, v.Name)
}

// DescribeExternalFunctionOptions is based on https://docs.snowflake.com/en/sql-reference/sql/desc-function.
Expand Down
5 changes: 1 addition & 4 deletions pkg/sdk/functions_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package sdk
import (
"context"
"database/sql"
"strings"
)

type Functions interface {
Expand Down Expand Up @@ -244,9 +243,7 @@ type Function struct {
}

func (v *Function) ID() SchemaObjectIdentifier {
database := strings.Trim(v.CatalogName, "\"")
schema := strings.Trim(v.SchemaName, "\"")
return NewSchemaObjectIdentifier(database, schema, v.Name)
return NewSchemaObjectIdentifier(v.CatalogName, v.SchemaName, v.Name)
}

// DescribeFunctionOptions is based on https://docs.snowflake.com/en/sql-reference/sql/desc-function.
Expand Down
5 changes: 1 addition & 4 deletions pkg/sdk/procedures_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package sdk
import (
"context"
"database/sql"
"strings"
)

type Procedures interface {
Expand Down Expand Up @@ -238,9 +237,7 @@ type Procedure struct {
}

func (v *Procedure) ID() SchemaObjectIdentifier {
database := strings.Trim(v.CatalogName, "\"")
schema := strings.Trim(v.SchemaName, "\"")
return NewSchemaObjectIdentifier(database, schema, v.Name)
return NewSchemaObjectIdentifier(v.CatalogName, v.SchemaName, v.Name)
}

// DescribeProcedureOptions is based on https://docs.snowflake.com/en/sql-reference/sql/desc-procedure.
Expand Down
2 changes: 1 addition & 1 deletion pkg/sdk/testint/alerts_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ func TestInt_AlertsShowByID(t *testing.T) {
t.Cleanup(cleanupAlertHandle(t, id))
}

t.Run("show by id", func(t *testing.T) {
t.Run("show by id - same name in different schemas", func(t *testing.T) {
schema, schemaCleanup := createSchemaWithIdentifier(t, client, databaseTest, random.AlphaN(8))
t.Cleanup(schemaCleanup)

Expand Down
2 changes: 1 addition & 1 deletion pkg/sdk/testint/application_roles_gen_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func TestInt_ApplicationRoles(t *testing.T) {
assertApplicationRole(t, appRole, name, comment)
}

t.Run("Show by id", func(t *testing.T) {
t.Run("show by id - same name in different schemas", func(t *testing.T) {
name := "app_role_1"
id := sdk.NewDatabaseObjectIdentifier(appName, name)
ctx := context.Background()
Expand Down
2 changes: 1 addition & 1 deletion pkg/sdk/testint/dynamic_table_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func TestInt_DynamicTablesShowByID(t *testing.T) {
t.Cleanup(cleanupDynamicTableHandle(t, id))
}

t.Run("show by id", func(t *testing.T) {
t.Run("show by id - same name in different schemas", func(t *testing.T) {
schema, schemaCleanup := createSchemaWithIdentifier(t, client, databaseTest, random.AlphaN(8))
t.Cleanup(schemaCleanup)

Expand Down
2 changes: 1 addition & 1 deletion pkg/sdk/testint/event_tables_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func TestInt_EventTableShowByID(t *testing.T) {
t.Cleanup(cleanupEventTableHandle(t, id))
}

t.Run("show by id", func(t *testing.T) {
t.Run("show by id - same name in different schemas", func(t *testing.T) {
schema, schemaCleanup := createSchemaWithIdentifier(t, client, databaseTest, random.AlphaN(8))
t.Cleanup(schemaCleanup)

Expand Down
2 changes: 1 addition & 1 deletion pkg/sdk/testint/external_functions_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ func TestInt_ExternalFunctionsShowByID(t *testing.T) {
t.Cleanup(cleanupExternalFuncionHandle(id, []sdk.DataType{sdk.DataTypeVariant}))
}

t.Run("show by id", func(t *testing.T) {
t.Run("show by id - same name in different schemas", func(t *testing.T) {
schema, schemaCleanup := createSchemaWithIdentifier(t, client, databaseTest, random.AlphaN(8))
t.Cleanup(schemaCleanup)

Expand Down
4 changes: 2 additions & 2 deletions pkg/sdk/testint/external_tables_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ func TestInt_ExternalTablesShowByID(t *testing.T) {
ctx := testContext(t)

databaseTest, schemaTest := testDb(t), testSchema(t)
stage := sdk.NewSchemaObjectIdentifier(TestDatabaseName, TestSchemaName, "EXTERNAL_TABLE_STAGE")
stage := sdk.NewSchemaObjectIdentifier(TestDatabaseName, TestSchemaName, random.AlphaN(6))
_, stageCleanup := createStageWithURL(t, client, stage, nycWeatherDataURL)
t.Cleanup(stageCleanup)

Expand All @@ -446,7 +446,7 @@ func TestInt_ExternalTablesShowByID(t *testing.T) {
t.Cleanup(cleanupExternalTableHandle(t, id))
}

t.Run("show by id", func(t *testing.T) {
t.Run("show by id - same name in different schemas", func(t *testing.T) {
schema, schemaCleanup := createSchemaWithIdentifier(t, client, databaseTest, random.AlphaN(8))
t.Cleanup(schemaCleanup)

Expand Down
2 changes: 1 addition & 1 deletion pkg/sdk/testint/file_format_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ func TestInt_FileFormatsShowByID(t *testing.T) {
t.Cleanup(cleanupFileFormatHandle(t, id))
}

t.Run("show by id", func(t *testing.T) {
t.Run("show by id - same name in different schemas", func(t *testing.T) {
schema, schemaCleanup := createSchemaWithIdentifier(t, client, databaseTest, random.AlphaN(8))
t.Cleanup(schemaCleanup)

Expand Down
2 changes: 1 addition & 1 deletion pkg/sdk/testint/functions_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ func TestInt_FunctionsShowByID(t *testing.T) {
t.Cleanup(cleanupFunctionHandle(id, []sdk.DataType{sdk.DataTypeFloat}))
}

t.Run("show by id", func(t *testing.T) {
t.Run("show by id - same name in different schemas", func(t *testing.T) {
schema, schemaCleanup := createSchemaWithIdentifier(t, client, databaseTest, random.AlphaN(8))
t.Cleanup(schemaCleanup)

Expand Down
2 changes: 1 addition & 1 deletion pkg/sdk/testint/masking_policy_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ func TestInt_MaskingPoliciesShowByID(t *testing.T) {
t.Cleanup(cleanupMaskingPolicyHandle(t, id))
}

t.Run("show by id", func(t *testing.T) {
t.Run("show by id - same name in different schemas", func(t *testing.T) {
schema, schemaCleanup := createSchemaWithIdentifier(t, client, databaseTest, random.AlphaN(8))
t.Cleanup(schemaCleanup)

Expand Down
2 changes: 1 addition & 1 deletion pkg/sdk/testint/materialized_views_gen_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ func TestInt_MaterializedViewsShowByID(t *testing.T) {
t.Cleanup(cleanupMaterializedViewHandle(t, id))
}

t.Run("show by id", func(t *testing.T) {
t.Run("show by id - same name in different schemas", func(t *testing.T) {
schema, schemaCleanup := createSchemaWithIdentifier(t, client, databaseTest, random.AlphaN(8))
t.Cleanup(schemaCleanup)

Expand Down
2 changes: 1 addition & 1 deletion pkg/sdk/testint/network_rule_gen_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func TestInt_NetworkRulesShowByID(t *testing.T) {
t.Cleanup(cleanupNetworkRuleHandle(t, id))
}

t.Run("show by id", func(t *testing.T) {
t.Run("show by id - same name in different schemas", func(t *testing.T) {
schema, schemaCleanup := createSchemaWithIdentifier(t, client, databaseTest, random.AlphaN(8))
t.Cleanup(schemaCleanup)

Expand Down
2 changes: 1 addition & 1 deletion pkg/sdk/testint/password_policy_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ func TestInt_PasswordPoliciesShowByID(t *testing.T) {
t.Cleanup(cleanupPasswordPolicyHandle(t, id))
}

t.Run("show by id", func(t *testing.T) {
t.Run("show by id - same name in different schemas", func(t *testing.T) {
schema, schemaCleanup := createSchemaWithIdentifier(t, client, databaseTest, random.AlphaN(8))
t.Cleanup(schemaCleanup)

Expand Down
2 changes: 1 addition & 1 deletion pkg/sdk/testint/pipes_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ func TestInt_PipesShowByID(t *testing.T) {
t.Cleanup(cleanupPipeHandle(t, id))
}

t.Run("show by id", func(t *testing.T) {
t.Run("show by id - same name in different schemas", func(t *testing.T) {
schema, schemaCleanup := createSchemaWithIdentifier(t, client, databaseTest, random.AlphaN(8))
t.Cleanup(schemaCleanup)

Expand Down
2 changes: 1 addition & 1 deletion pkg/sdk/testint/procedures_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ func TestInt_ProceduresShowByID(t *testing.T) {
t.Cleanup(cleanupProcedureHandle(id, []sdk.DataType{sdk.DataTypeVARCHAR}))
}

t.Run("show by id", func(t *testing.T) {
t.Run("show by id - same name in different schemas", func(t *testing.T) {
schema, schemaCleanup := createSchemaWithIdentifier(t, client, databaseTest, random.AlphaN(8))
t.Cleanup(schemaCleanup)

Expand Down
2 changes: 1 addition & 1 deletion pkg/sdk/testint/roles_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func TestInt_Roles(t *testing.T) {
assert.Equal(t, "USER", roles[0].Name)
})

t.Run("show by id", func(t *testing.T) {
t.Run("show by id - same name in different schemas", func(t *testing.T) {
role, cleanup := createRole(t, client)
t.Cleanup(cleanup)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ func TestInt_RowAccessPoliciesShowByID(t *testing.T) {
t.Cleanup(cleanupRowAccessPolicyHandle(id))
}

t.Run("show by id", func(t *testing.T) {
t.Run("show by id - same name in different schemas", func(t *testing.T) {
schema, schemaCleanup := createSchemaWithIdentifier(t, client, databaseTest, random.AlphaN(8))
t.Cleanup(schemaCleanup)

Expand Down
2 changes: 1 addition & 1 deletion pkg/sdk/testint/sequences_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func TestInt_SequencesShowByID(t *testing.T) {
t.Cleanup(cleanupSequenceHandle(t, id))
}

t.Run("show by id", func(t *testing.T) {
t.Run("show by id - same name in different schemas", func(t *testing.T) {
schema, schemaCleanup := createSchemaWithIdentifier(t, client, databaseTest, random.AlphaN(8))
t.Cleanup(schemaCleanup)

Expand Down
2 changes: 1 addition & 1 deletion pkg/sdk/testint/stages_gen_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ func TestInt_StagesShowByID(t *testing.T) {
t.Cleanup(cleanupStageHandle(id))
}

t.Run("show by id", func(t *testing.T) {
t.Run("show by id - same name in different schemas", func(t *testing.T) {
schema, schemaCleanup := createSchemaWithIdentifier(t, client, databaseTest, random.AlphaN(8))
t.Cleanup(schemaCleanup)

Expand Down
2 changes: 1 addition & 1 deletion pkg/sdk/testint/streamlits_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func TestInt_StreamlitsShowByID(t *testing.T) {
t.Cleanup(cleanupStreamlitHandle(t, id))
}

t.Run("show by id", func(t *testing.T) {
t.Run("show by id - same name in different schemas", func(t *testing.T) {
schema, schemaCleanup := createSchemaWithIdentifier(t, client, databaseTest, random.AlphaN(8))
t.Cleanup(schemaCleanup)

Expand Down
2 changes: 1 addition & 1 deletion pkg/sdk/testint/streams_gen_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ func TestInt_StreamsShowByID(t *testing.T) {
t.Cleanup(cleanupStreamHandle(id))
}

t.Run("show by id", func(t *testing.T) {
t.Run("show by id - same name in different schemas", func(t *testing.T) {
schema, schemaCleanup := createSchemaWithIdentifier(t, client, databaseTest, random.AlphaN(8))
t.Cleanup(schemaCleanup)

Expand Down
2 changes: 1 addition & 1 deletion pkg/sdk/testint/tables_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ func TestInt_TablesShowByID(t *testing.T) {
t.Cleanup(cleanupTableHandle(id))
}

t.Run("show by id", func(t *testing.T) {
t.Run("show by id - same name in different schemas", func(t *testing.T) {
schema, schemaCleanup := createSchemaWithIdentifier(t, client, databaseTest, random.AlphaN(8))
t.Cleanup(schemaCleanup)

Expand Down
2 changes: 1 addition & 1 deletion pkg/sdk/testint/tags_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ func TestInt_TagsShowByID(t *testing.T) {
t.Cleanup(cleanupTagHandle(id))
}

t.Run("show by id", func(t *testing.T) {
t.Run("show by id - same name in different schemas", func(t *testing.T) {
schema, schemaCleanup := createSchemaWithIdentifier(t, client, databaseTest, random.AlphaN(8))
t.Cleanup(schemaCleanup)

Expand Down
2 changes: 1 addition & 1 deletion pkg/sdk/testint/tasks_gen_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ func TestInt_TasksShowByID(t *testing.T) {
t.Cleanup(cleanupTaskHandle(id))
}

t.Run("show by id", func(t *testing.T) {
t.Run("show by id - same name in different schemas", func(t *testing.T) {
schema, schemaCleanup := createSchemaWithIdentifier(t, client, databaseTest, random.AlphaN(8))
t.Cleanup(schemaCleanup)

Expand Down
2 changes: 1 addition & 1 deletion pkg/sdk/testint/views_gen_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ func TestInt_ViewsShowByID(t *testing.T) {
t.Cleanup(cleanupViewHandle(id))
}

t.Run("show by id", func(t *testing.T) {
t.Run("show by id - same name in different schemas", func(t *testing.T) {
schema, schemaCleanup := createSchemaWithIdentifier(t, client, databaseTest, random.AlphaN(8))
t.Cleanup(schemaCleanup)

Expand Down

0 comments on commit 8e3aace

Please sign in to comment.