Skip to content

docs: document set_config transaction-local gotcha in pgsql-test#1143

Merged
pyramation merged 1 commit into
mainfrom
docs/pgsql-test-transaction-context
May 12, 2026
Merged

docs: document set_config transaction-local gotcha in pgsql-test#1143
pyramation merged 1 commit into
mainfrom
docs/pgsql-test-transaction-context

Conversation

@pyramation
Copy link
Copy Markdown
Contributor

Summary

Adds documentation about the transaction-local behavior of set_config(..., true) in two places:

postgres/pgsql-test/README.md

  • Added a warning callout in the "Role-Based Context" section explaining that setContext() uses set_config(..., true) which is transaction-local
  • Inside it() blocks this works automatically (transaction started by beforeEach)
  • In beforeAll(), context is lost between queries — must wrap in explicit db.begin()/db.commit()
  • Includes code example showing the correct pattern

postgres/pgsql-test/AGENTS.md

  • Added a new "Transaction-Local Context" section with the same key information in concise format for AI agents

Review & Testing Checklist for Human

  • Verify the explanation matches the actual implementation in pgsql-client/src/context-utils.ts (set_config with true for is_local)

Notes

Documentation-only change. Companion PRs going to constructive-db and constructive-skills repos.

Link to Devin session: https://app.devin.ai/sessions/ef4c0849684f44b4bb4dd83074c27d48
Requested by: @pyramation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@pyramation pyramation merged commit 57395ff into main May 12, 2026
69 of 70 checks passed
@pyramation pyramation deleted the docs/pgsql-test-transaction-context branch May 12, 2026 21:48
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