Skip to content

feat(protos): add Postgres + Supabase config messages (Phase 3c) - #6

Closed
ihistand wants to merge 1 commit into
adapter/postgres-relocatefrom
adapter/postgres-proto-additions
Closed

feat(protos): add Postgres + Supabase config messages (Phase 3c)#6
ihistand wants to merge 1 commit into
adapter/postgres-relocatefrom
adapter/postgres-proto-additions

Conversation

@ihistand

Copy link
Copy Markdown
Collaborator

Summary

Phase 3c of `adapter/postgres-first-class` per `docs/postgres_first_class_design.md` §3 + §8.2.

Adds the proto messages the Postgres-first-class adapter needs. Additive only — nothing references these yet. Wiring happens in subsequent phases.

Added messages

Action-level option blocks (peers of the existing inlined BigQuery fields)

Message Purpose
`PostgresOptions` `tablespace`, `fillfactor`, `unlogged`, native declarative partitioning (RANGE/LIST/HASH), btree/gin/gist/hash/brin indexes, materialized view refresh policy
`SupabaseOptions` Realtime publication, RLS enable, owner role, pgvector convenience config; nests `PostgresOptions`

Top-level connection config (will live under `WorkflowSettings.warehouse` in Phase 4)

Message Purpose
`BigQueryConnection` `project`, `location`, `default_dataset`
`PostgresConnection` libpq-style: `host`, `port`, `database`, `user`, `password`, `ssl_mode`, `default_schema`
`SupabaseConnection` `project_ref`, `service_role_key`, `default_schema`, optional direct `connection_string` override
`WarehouseConfig` Discriminated union over the three connection variants via `oneof connection`

Why additive only

Wiring `PostgresOptions` into `ActionConfig.TableConfig` etc. requires choosing field numbers across 4 messages (TableConfig, ViewConfig, IncrementalTableConfig, OperationConfig) and is a separate concern. Same for `WarehouseConfig` → `WorkflowSettings.warehouse`, which collides semantically with the legacy flat `default_project` / `default_dataset` / `default_location` fields and needs careful migration.

The messages exist; consumers come next.

Verification

```bash
./scripts/docker-bazel build //protos:ts # → success
./scripts/docker-bazel build //... # → success (139 targets)
```

Stack

Stacked on PR #5 (`adapter/postgres-relocate`). Merge order: #1#2#3#4#5 → this.

Next phases

  • Phase 3a — `PostgresDbAdapter` against current `IDbAdapter` contract; consumes `PostgresConnection`
  • Phase 4 — wire `WorkflowSettings.warehouse`; CLI dispatches on `warehouse.kind`
  • Phase 5 — `SupabaseDbAdapter` + `rlsPolicy`/`realtimePublication`/`wrapper`/`vectorIndex` action types consume `SupabaseOptions`

Test plan

  • `./scripts/docker-bazel build //protos:ts`
  • `./scripts/docker-bazel build //...` (139 targets)
  • Wiring into ActionConfig sub-messages (Phase 3a/4)

🤖 Generated with Claude Code

Adds the proto messages that the Postgres-first-class adapter needs,
per docs/postgres_first_class_design.md §3 + §8.2:

Action-level option blocks:
- PostgresOptions       — tablespace, fillfactor, unlogged, native
                          declarative partitioning, btree/gin/gist/hash/
                          brin indexes, materialized view refresh policy
- SupabaseOptions       — Realtime publication, RLS enable, owner role,
                          pgvector convenience config; nests PostgresOptions

Top-level connection config:
- BigQueryConnection    — project, location, default_dataset
- PostgresConnection    — host, port, database, user, password, ssl_mode,
                          default_schema (libpq-style)
- SupabaseConnection    — project_ref, service_role_key, default_schema,
                          optional direct connection_string override
- WarehouseConfig       — discriminated union over the three connection
                          variants via `oneof connection`

This PR is **additive only**. Nothing references these messages yet —
wiring into ActionConfig sub-messages (TableConfig, IncrementalTableConfig,
etc.) and WorkflowSettings happens in subsequent phases:

- Phase 3a   PostgresDbAdapter consumes PostgresConnection
- Phase 4    WorkflowSettings gets a `warehouse: WarehouseConfig` field;
             CLI dispatches on warehouse.kind
- Phase 5    SupabaseDbAdapter + rlsPolicy/realtimePublication/wrapper/
             vectorIndex action types consume SupabaseOptions

Verified:
  ./scripts/docker-bazel build //protos:ts   → success
  ./scripts/docker-bazel build //...         → success (139 targets)
@ihistand

ihistand commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded: the Postgres reintegration + Dataform→SQLAnvil rename landed on main directly, and the docs moved to the SQLAnvil/docs repo. Closing as part of #12 (stale-branch prune). The one un-migrated draft, gcp_test_project_setup.md, was migrated to SQLAnvil/docs.

@ihistand ihistand closed this Jun 7, 2026
@ihistand
ihistand deleted the adapter/postgres-proto-additions branch June 7, 2026 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant