Skip to content

Commit

Permalink
Fix a typo
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbyiliev committed Sep 27, 2024
1 parent 02c1e01 commit 637ac94
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 0 additions & 6 deletions pkg/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,6 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData, version stri
log.Printf("[ERROR] Error initializing DB client for region %s: %v\n", provider.ID, diags)
continue
}
// Explicitly set the transaction isolation level to 'strict serializable' for each region
_, err = dbClient.Exec("SET TRANSACTION_ISOLATION TO 'STRICT SERIALIZABLE''")
if err != nil {
log.Printf("[ERROR] Failed to set transaction isolation level for region %s: %v\n", provider.ID, err)
continue
}

dbClients[clients.Region(provider.ID)] = dbClient
}
Expand Down
7 changes: 7 additions & 0 deletions pkg/utils/provider_meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package utils

import (
"fmt"
"log"
"strings"

"github.com/MaterializeInc/terraform-provider-materialize/pkg/clients"
Expand Down Expand Up @@ -94,6 +95,12 @@ func GetDBClientFromMeta(meta interface{}, d *schema.ResourceData) (*sqlx.DB, cl
return nil, region, fmt.Errorf("no database client for region: %s", region)
}

// Explicitly set the transaction isolation level to 'strict serializable'
_, err = dbClient.Exec("SET TRANSACTION_ISOLATION TO 'STRICT SERIALIZABLE'")
if err != nil {
log.Printf("[ERROR] Failed to set transaction isolation level for region %s: %v\n", region, err)
}

return dbClient.SQLX(), region, nil
}

Expand Down

0 comments on commit 637ac94

Please sign in to comment.