Skip to content

Conversation

@OreoYang
Copy link
Contributor

@OreoYang OreoYang commented Feb 10, 2026

ISSUE #93
Since IvorySQL is a PostgreSQL-based database with Oracle compatibility features, modifications to system prompts are required. Therefore, this feature is submitted to support prompt customization, with the docs and tests assisted by @claude.

  • Add [prompts] section to configuration file
  • Support custom system_prompt and explain_system_prompt
  • Accept both inline strings and file paths for prompts
  • Fallback to built-in defaults when not configured
  • Update query_generator to use new prompt getter functions
  • Add comprehensive unit tests (14 test cases)
  • Update configuration documentation with examples

Automatic fallback to built-in defaults when not configured

Option 1: Inline String (Short Prompts)

~/.pg_ai.config
[prompts]
system_prompt = "You are a PostgreSQL expert for financial data. Always include index recommendations."
explain_system_prompt = "Focus on materialized view usage and query optimization."

Option 2: File Path (Long Prompts - Recommended)

~/.pg_ai.config
[prompts]
system_prompt = /home/user/.pg_ai.prompts
explain_system_prompt = /home/user/.pg_ai.explain.prompts

- Add [prompts] section to configuration file
- Support custom system_prompt and explain_system_prompt
- Accept both inline strings and file paths for prompts
- Fallback to built-in defaults when not configured
- Update query_generator to use new prompt getter functions
- Add comprehensive unit tests (14 test cases)
- Update configuration documentation with examples

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@OreoYang OreoYang requested a review from benodiwal as a code owner February 10, 2026 02:55
OreoYang and others added 2 commits February 10, 2026 13:07
- Remove hardcoded local paths from test cases
- Use getFixturesPath() for environment-independent path resolution
- Replace directory switching with absolute path construction
- Add fstream header for file operations

Fixes test failures in:
- GetSystemPromptLoadsFromFile
- GetExplainSystemPromptLoadsFromFile

All 111 tests now pass successfully.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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