feat(agentd): support configured db schema#103
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bd170edd94
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| assertValidAuthoritySchemaName(schemaName) | ||
|
|
||
| const url = new URL(connectionString) | ||
| url.searchParams.set('options', `-c search_path=${schemaName},public`) |
There was a problem hiding this comment.
Quote the configured schema in the search path
When AGENTD_DB_SCHEMA contains uppercase letters, the migration creates a quoted mixed-case schema via CREATE SCHEMA ... "${schemaName}", but the connection option here sets an unquoted search_path. Postgres folds unquoted identifiers to lowercase, so a value like AgentD creates schema "AgentD" while the client searches agentd,public, causing the authority tables to be created/read from public instead of the configured schema. Either reject non-lowercase names or quote/escape the schema consistently in the search path.
Useful? React with 👍 / 👎.
Summary
Verification