From 4065367ea6cb9a4d9862a980a90b51c8e7987781 Mon Sep 17 00:00:00 2001 From: Mahdi Dibaiee Date: Fri, 15 Mar 2024 17:40:11 +0000 Subject: [PATCH] materialize-snowflake: use dialect identifier transformer for schema --- materialize-snowflake/client.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/materialize-snowflake/client.go b/materialize-snowflake/client.go index b1f053ce34..ef4c1aad4a 100644 --- a/materialize-snowflake/client.go +++ b/materialize-snowflake/client.go @@ -67,11 +67,11 @@ func (c *client) CreateTable(ctx context.Context, tc sql.TableCreate) error { } defer conn.Close() - if _, err := conn.ExecContext(ctx, fmt.Sprintf("CREATE SCHEMA IF NOT EXISTS %q", schemaName)); err != nil { + if _, err := conn.ExecContext(ctx, fmt.Sprintf("CREATE SCHEMA IF NOT EXISTS %s", c.ep.Dialect.Identifier(schemaName))); err != nil { return err } - if _, err := conn.ExecContext(ctx, fmt.Sprintf("USE SCHEMA %q", c.cfg.Schema)); err != nil { + if _, err := conn.ExecContext(ctx, fmt.Sprintf("USE SCHEMA %s", c.ep.Dialect.Identifier(c.cfg.Schema))); err != nil { return err } @@ -89,7 +89,7 @@ func (c *client) DeleteTable(ctx context.Context, path []string) (string, boiler } defer conn.Close() - if _, err := conn.ExecContext(ctx, fmt.Sprintf("USE SCHEMA %q", c.cfg.Schema)); err != nil { + if _, err := conn.ExecContext(ctx, fmt.Sprintf("USE SCHEMA %s", c.ep.Dialect.Identifier(c.cfg.Schema))); err != nil { return err } _, err = conn.ExecContext(ctx, stmt) @@ -111,7 +111,7 @@ func (c *client) AlterTable(ctx context.Context, ta sql.TableAlter) (string, boi } defer conn.Close() - if _, err := conn.ExecContext(ctx, fmt.Sprintf("USE SCHEMA %q", c.cfg.Schema)); err != nil { + if _, err := conn.ExecContext(ctx, fmt.Sprintf("USE SCHEMA %s", c.ep.Dialect.Identifier(c.cfg.Schema))); err != nil { return err } _, err = conn.ExecContext(ctx, alterColumnStmt)