diff --git a/integration/materialized_view.tf b/integration/materialized_view.tf index 2060a862..212324e7 100644 --- a/integration/materialized_view.tf +++ b/integration/materialized_view.tf @@ -1,8 +1,20 @@ resource "materialize_materialized_view" "simple_materialized_view" { - name = "simple_materialized_view" + name = "simple_materialized_view" + schema_name = materialize_schema.schema.name + database_name = materialize_database.database.name + comment = "materialize view comment" + cluster_name = "default" + + statement = < 0 { var na []string for _, n := range b.notNullAssertions { - f := fmt.Sprintf("ASSERT NOT NULL %s", QuoteString(n)) + f := fmt.Sprintf("ASSERT NOT NULL %s", QuoteIdentifier(n)) na = append(na, f) } q.WriteString(fmt.Sprintf(` WITH (%s)`, strings.Join(na[:], ", "))) diff --git a/pkg/materialize/materialized_view_test.go b/pkg/materialize/materialized_view_test.go index 96748cdc..7a2d5de9 100644 --- a/pkg/materialize/materialized_view_test.go +++ b/pkg/materialize/materialized_view_test.go @@ -11,7 +11,7 @@ import ( func TestMaterializedViewCreate(t *testing.T) { testhelpers.WithMockDb(t, func(db *sqlx.DB, mock sqlmock.Sqlmock) { mock.ExpectExec( - `CREATE MATERIALIZED VIEW "database"."schema"."materialized_view" IN CLUSTER "cluster" WITH \(ASSERT NOT NULL 'column_1', ASSERT NOT NULL 'column_2'\) AS SELECT 1 FROM t1;`, + `CREATE MATERIALIZED VIEW "database"."schema"."materialized_view" IN CLUSTER "cluster" WITH \(ASSERT NOT NULL "column_1", ASSERT NOT NULL "column_2"\) AS SELECT 1 FROM t1;`, ).WillReturnResult(sqlmock.NewResult(1, 1)) o := MaterializeObject{Name: "materialized_view", SchemaName: "schema", DatabaseName: "database"} diff --git a/pkg/provider/acceptance_materialized_view_grant_test.go b/pkg/provider/acceptance_materialized_view_grant_test.go index a157ec9a..4170b85c 100644 --- a/pkg/provider/acceptance_materialized_view_grant_test.go +++ b/pkg/provider/acceptance_materialized_view_grant_test.go @@ -89,11 +89,10 @@ resource "materialize_schema" "test" { } resource "materialize_materialized_view" "test" { - name = "%s" - schema_name = materialize_schema.test.name - database_name = materialize_database.test.name - cluster_name = "default" - not_null_assertion = ["id"] + name = "%s" + schema_name = materialize_schema.test.name + database_name = materialize_database.test.name + cluster_name = "default" statement = <