Skip to content

Commit

Permalink
experimentally opted out storageused from db (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
KnockOutEZ authored Sep 30, 2024
1 parent bf8161f commit 89fc078
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
12 changes: 6 additions & 6 deletions internals/provider/database/data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ type DatabaseModel struct {
CreatedAt types.String `tfsdk:"created_at"`
UpdatedAt types.String `tfsdk:"updated_at"`
PgVersion types.String `tfsdk:"pg_version"`
StorageUsed types.Int64 `tfsdk:"storage_used"`
// StorageUsed types.Int64 `tfsdk:"storage_used"`
Domain types.String `tfsdk:"domain"`
ConfigVersion types.String `tfsdk:"config_version"`
Options types.List `tfsdk:"options"`
Expand Down Expand Up @@ -104,10 +104,10 @@ func (d *databasesDataSource) Schema(_ context.Context, _ datasource.SchemaReque
Computed: true,
Description: "PostgreSQL version of the database",
},
"storage_used": schema.Int64Attribute{
Computed: true,
Description: "Storage used by the database in bytes",
},
// "storage_used": schema.Int64Attribute{
// Computed: true,
// Description: "Storage used by the database in bytes",
// },
"domain": schema.StringAttribute{
Computed: true,
Description: "Domain of the database",
Expand Down Expand Up @@ -181,7 +181,7 @@ func (d *databasesDataSource) Read(ctx context.Context, req datasource.ReadReque
CreatedAt: types.StringPointerValue(db.CreatedAt),
UpdatedAt: types.StringPointerValue(db.UpdatedAt),
PgVersion: types.StringValue(db.PgVersion),
StorageUsed: types.Int64Value(db.StorageUsed),
// StorageUsed: types.Int64Value(db.StorageUsed),
Domain: types.StringValue(db.Domain),
ConfigVersion: types.StringValue(db.ConfigVersion),
Options: d.convertToListValue(db.Options),
Expand Down
18 changes: 9 additions & 9 deletions internals/provider/database/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ func (r *databaseResource) Schema(_ context.Context, _ resource.SchemaRequest, r
},
Computed: true,
},
"storage_used": schema.Int64Attribute{
Description: "The amount of storage used by the database in bytes.",
PlanModifiers: []planmodifier.Int64{
int64planmodifier.RequiresReplaceIfConfigured(),
},
Computed: true,
},
// "storage_used": schema.Int64Attribute{
// Description: "The amount of storage used by the database in bytes.",
// PlanModifiers: []planmodifier.Int64{
// int64planmodifier.RequiresReplaceIfConfigured(),
// },
// Computed: true,
// },
"domain": schema.StringAttribute{
Description: "The domain associated with the database.",
Computed: true,
Expand Down Expand Up @@ -1100,7 +1100,7 @@ func (r *databaseResource) mapDatabaseToResourceModel(database *models.Database)
CreatedAt: types.StringPointerValue(database.CreatedAt),
UpdatedAt: types.StringPointerValue(database.UpdatedAt),
PgVersion: types.StringValue(database.PgVersion),
StorageUsed: types.Int64Value(database.StorageUsed),
// StorageUsed: types.Int64Value(database.StorageUsed),
Domain: types.StringValue(database.Domain),
ConfigVersion: types.StringValue(database.ConfigVersion),
Options: convertToListValue(database.Options),
Expand Down Expand Up @@ -1518,7 +1518,7 @@ type databaseResourceModel struct {
CreatedAt types.String `tfsdk:"created_at"`
UpdatedAt types.String `tfsdk:"updated_at"`
PgVersion types.String `tfsdk:"pg_version"`
StorageUsed types.Int64 `tfsdk:"storage_used"`
// StorageUsed types.Int64 `tfsdk:"storage_used"`
Domain types.String `tfsdk:"domain"`
ConfigVersion types.String `tfsdk:"config_version"`
Options types.List `tfsdk:"options"`
Expand Down

0 comments on commit 89fc078

Please sign in to comment.