feat: add database_id attribute to resource model and update related functions

This commit is contained in:
Andre_Harms 2026-02-05 09:14:03 +01:00
parent 502b2f5e0a
commit 91913c3446
6 changed files with 90 additions and 65 deletions

View file

@ -3,6 +3,7 @@ package postgresflexalpha
import (
"context"
"fmt"
"strings"
postgresflex "tf-provider.git.onstackit.cloud/stackit-dev-tools/terraform-provider-stackitprivatepreview/pkg_gen/postgresflexalpha"
)
@ -79,3 +80,12 @@ func getDatabase(
return nil, fmt.Errorf("database not found for instance %s", instanceId)
}
// cleanString removes leading and trailing quotes which are sometimes returned by the API.
func cleanString(s *string) *string {
if s == nil {
return nil
}
res := strings.Trim(*s, "\"")
return &res
}