From a60eb9055bdc137156438791fea8ec1d26f69656 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Thu, 18 Jun 2026 10:42:54 +0200 Subject: [PATCH] acc: read postgres top-level ID fields directly in direct engine The SDK bump to v0.147.0 (#5636) added top-level ID fields (project_id, branch_id, endpoint_id, database_id, role_id) to the postgres resource types, which the real Lakebase GET APIs now return. The direct engine make*Remote helpers previously dug the ID out of the status subobject; read the top-level field directly instead. Co-authored-by: Isaac --- bundle/direct/dresources/postgres_branch.go | 6 +----- bundle/direct/dresources/postgres_database.go | 6 +----- bundle/direct/dresources/postgres_endpoint.go | 6 +----- bundle/direct/dresources/postgres_project.go | 6 +----- bundle/direct/dresources/postgres_role.go | 6 +----- 5 files changed, 5 insertions(+), 25 deletions(-) diff --git a/bundle/direct/dresources/postgres_branch.go b/bundle/direct/dresources/postgres_branch.go index 4f234d947dc..82b50f8a10c 100644 --- a/bundle/direct/dresources/postgres_branch.go +++ b/bundle/direct/dresources/postgres_branch.go @@ -78,13 +78,9 @@ func makePostgresBranchRemote(branch *postgres.Branch) *PostgresBranchRemote { if branch.Spec != nil { spec = *branch.Spec } - var branchID string - if branch.Status != nil { - branchID = branch.Status.BranchId - } return &PostgresBranchRemote{ BranchSpec: spec, - BranchId: branchID, + BranchId: branch.BranchId, Parent: branch.Parent, Name: branch.Name, Status: branch.Status, diff --git a/bundle/direct/dresources/postgres_database.go b/bundle/direct/dresources/postgres_database.go index d412eb94b8c..8d98606d70d 100644 --- a/bundle/direct/dresources/postgres_database.go +++ b/bundle/direct/dresources/postgres_database.go @@ -72,13 +72,9 @@ func makePostgresDatabaseRemote(database *postgres.Database) *PostgresDatabaseRe if database.Spec != nil { spec = *database.Spec } - var databaseID string - if database.Status != nil { - databaseID = database.Status.DatabaseId - } return &PostgresDatabaseRemote{ DatabaseDatabaseSpec: spec, - DatabaseId: databaseID, + DatabaseId: database.DatabaseId, Parent: database.Parent, Name: database.Name, Status: database.Status, diff --git a/bundle/direct/dresources/postgres_endpoint.go b/bundle/direct/dresources/postgres_endpoint.go index eef2cd766e1..c370ff120be 100644 --- a/bundle/direct/dresources/postgres_endpoint.go +++ b/bundle/direct/dresources/postgres_endpoint.go @@ -87,13 +87,9 @@ func makePostgresEndpointRemote(endpoint *postgres.Endpoint) *PostgresEndpointRe if endpoint.Spec != nil { spec = *endpoint.Spec } - var endpointID string - if endpoint.Status != nil { - endpointID = endpoint.Status.EndpointId - } return &PostgresEndpointRemote{ EndpointSpec: spec, - EndpointId: endpointID, + EndpointId: endpoint.EndpointId, Parent: endpoint.Parent, Name: endpoint.Name, Status: endpoint.Status, diff --git a/bundle/direct/dresources/postgres_project.go b/bundle/direct/dresources/postgres_project.go index d6bd118dd64..02830b5d606 100644 --- a/bundle/direct/dresources/postgres_project.go +++ b/bundle/direct/dresources/postgres_project.go @@ -80,13 +80,9 @@ func makePostgresProjectRemote(project *postgres.Project) *PostgresProjectRemote if project.Spec != nil { spec = *project.Spec } - var projectID string - if project.Status != nil { - projectID = project.Status.ProjectId - } return &PostgresProjectRemote{ ProjectSpec: spec, - ProjectId: projectID, + ProjectId: project.ProjectId, InitialEndpointSpec: project.InitialEndpointSpec, Name: project.Name, Status: project.Status, diff --git a/bundle/direct/dresources/postgres_role.go b/bundle/direct/dresources/postgres_role.go index 2e0932e0c9b..d9e70b2feb5 100644 --- a/bundle/direct/dresources/postgres_role.go +++ b/bundle/direct/dresources/postgres_role.go @@ -85,13 +85,9 @@ func makePostgresRoleRemote(role *postgres.Role) *PostgresRoleRemote { if role.Spec != nil { spec = *role.Spec } - var roleID string - if role.Status != nil { - roleID = role.Status.RoleId - } return &PostgresRoleRemote{ RoleRoleSpec: spec, - RoleId: roleID, + RoleId: role.RoleId, Parent: role.Parent, Name: role.Name, Status: role.Status,