Skip to content

Add DB_SCHEMA support for PostgreSQL connections#2449

Merged
lancepioch merged 2 commits into
pelican-dev:mainfrom
l1monenko:patch-1
Jul 17, 2026
Merged

Add DB_SCHEMA support for PostgreSQL connections#2449
lancepioch merged 2 commits into
pelican-dev:mainfrom
l1monenko:patch-1

Conversation

@l1monenko

Copy link
Copy Markdown
Contributor

Summary

This PR adds support for configuring the PostgreSQL schema/search path through an environment variable.

Currently the PostgreSQL connection config uses a hardcoded public search path. This makes it difficult to run the panel in environments where a dedicated PostgreSQL schema is preferred instead of using the default public schema.

Changes

  • Added DB_SCHEMA environment variable support for PostgreSQL connections
  • Kept public as the default value to preserve current behavior
  • No breaking changes for existing installations

Example

DB_CONNECTION=pgsql
DB_SCHEMA=pelican

@github-actions

github-actions Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 516f0881-231d-4ef4-ae32-f3ae9cdb31c3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PostgreSQL schema can now be selected through the database settings command or DB_SCHEMA, with public remaining the default search path.

Changes

Database configuration

Layer / File(s) Summary
PostgreSQL schema selection command
app/Console/Commands/Environment/DatabaseSettingsCommand.php
The command accepts --schema, prompts for a schema when omitted, stores it in DB_SCHEMA, and uses it when testing the PostgreSQL connection.
Configurable PostgreSQL search path
config/database.php
The PostgreSQL search_path setting uses DB_SCHEMA with public as its fallback instead of a hard-coded value.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding DB_SCHEMA support for PostgreSQL connections.
Description check ✅ Passed The description matches the changeset by describing configurable PostgreSQL schema/search_path support with a public default.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@config/database.php`:
- Line 104: Update the temporary PostgreSQL connection construction in
DatabaseSettingsCommand to use the configured DB_SCHEMA value, defaulting
consistently to public, instead of hardcoding search_path to public. Keep the
connection test aligned with the application's database configuration.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 049d5ca7-842e-48e8-8f93-cc11098c6c62

📥 Commits

Reviewing files that changed from the base of the PR and between 1f2ff09 and 60c6832.

📒 Files selected for processing (1)
  • config/database.php

Comment thread config/database.php
@l1monenko

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@l1monenko

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@lancepioch
lancepioch merged commit c6d777f into pelican-dev:main Jul 17, 2026
17 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants