ReviewOS

home-lang/home

Port postgres.js TLS backpressure and CRUD integration

#292
Open chris opened this 9 days ago ·
9 days ago

Context

Bun corpus position 4044, js/third_party/postgres/postgres.test.ts, contains three test bodies gated together by TLS_POSTGRES_DATABASE_URL. It covers a TLS version query, 1,000 concurrent version queries exercising backpressure/resume behavior, and insert/select/delete lifecycle semantics.

Remaining work

  • Connect the callable postgres.js tagged-template adapter to Home's native PostgreSQL/TLS transport.
  • Support pooling/backpressure, safe resume after 50-query batches, returned-row shaping, CRUD with bound parameters, and idempotent cleanup.
  • Exercise deterministic local TLS transport where possible while preserving the upstream secret-backed path.
  • Ensure query/connect/close failures carry stable code, operation/phase, sanitized endpoint/database context, original cause, and operation stack frames without URL credentials or SQL parameter leakage.

Acceptance

  • Without TLS_POSTGRES_DATABASE_URL, the copied file remains one intentional skipped-suite todo covering all three test bodies.
  • With a compatible endpoint, all three upstream tests pass, including the 1,000-query workload.
  • Permanent coverage verifies lifecycle/backpressure behavior and redacted diagnostics.
  • #66 records the completed transport slice and corpus counts.
9 days ago

Bootstrap registration and safe failure handling landed in 92c769303; this issue remains open for native TLS/backpressure/CRUD execution.

Completed now:

  • The copied postgres import resolves as the callable CommonJS/default postgres.js export and reaches its credential gate.
  • Without TLS_POSTGRES_DATABASE_URL, position 4044 records one intentional skipped-suite todo covering all three test bodies, with no failure or unsupported syntax.
  • The tagged-template client exposes unsafe, options, and idempotent end lifecycle surfaces.
  • Bootstrap query failures use sanitized PostgresJSError diagnostics with stable code, operation/phase, endpoint/database context, original cause, and operation stacks.
  • Permanent coverage proves URL credentials and SQL text are absent from diagnostics.

Remaining: native PostgreSQL/TLS transport, the 1,000-query backpressure/resume workload, CRUD row semantics, and cleanup.

Sign in to comment on this issue.