Psql Query
Run ad-hoc PostgreSQL analytics queries against dev/test database
- Type
- Slash Command
- Repository
- oliver-kriska/claude-elixir-phoenix
- GitHub stars
- 556
- License
- MIT
- Repo last updated
- Sep 25, 2026
- Source file
- .claude/commands/psql-query.md
What Psql Query is
Psql Query is a slash command published in the oliver-kriska/claude-elixir-phoenix repository on GitHub, which has about 556 stars. The repository describes itself as: “Claude Code plugin for Elixir/Phoenix/LiveView — 26 specialist agents, Iron Laws enforcement, and Tidewave MCP integration. Plan features with parallel research agents, execute with automatic verification, review with 4-agent parallel audits, and capture learnings as reusable knowledge.”
A slash command is a reusable prompt saved as a markdown file and run by typing its name after a slash. In Claude Code, custom commands have been merged into skills: a file in .claude/commands/ and a skill folder in .claude/skills/ both create the same kind of command, and existing command files keep working.
Psql Query gives you a repeatable way to run the same instructions without retyping them, optionally with arguments.
How to install Psql Query
Claude Code
- Download psql-query.md from the repository.
- Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md.
- Run it by typing / followed by its name.
Claude Cowork
- Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it.
- In Customize → Skills, click +, then upload the ZIP.
- Run it from any task with / and the skill name.
New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.
Inside the source file
An excerpt from .claude/commands/psql-query.md, shared under the repository's MIT license. Read the full file on GitHub.
Run analytics queries against the local database using psql or mix run.
Rules
- NEVER run against production
- Use READ-ONLY queries (SELECT only)
- For complex analysis, use Repo.query/2 in a Mix task
- Format results as ASCII tables or pipe to column -t
Tidewave Integration
If Tidewave MCP is available, prefer it over psql/mix run:
- mcptidewaveexecute_sql_query for direct SQL queries
- mcptidewaveproject_eval for Ecto-based queries via Repo.query!/2 or Repo.all/1
Fall back to psql/mix run only if Tidewave is not detected.
Workflow
- Check if Tidewave MCP is available — if yes, use mcptidewaveexecute_sql_query
- Otherwise, detect database URL from config/dev.exs or DATABASE_URL
- Run query via: psql $DATABASE_URL -c "YOUR QUERY" --expanded
- For Ecto: mix run -e 'MyApp.Repo.query!("SELECT ...") |> IO.inspect()'
- Summarize results
Example prompts
- "How many users signed up this week?"
- "Show me the slowest queries from pg_stat_statements"
- "What's the table size distribution?"
- "Show index usage stats"
Before you install
- Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
- Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
- Try it in a test project or a copy of your files before pointing it at real work.
- Pin the version you tested, and review changes before updating.
- Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.
FAQ
What is Psql Query?
Psql Query is a slash command for Claude Code and Claude Cowork from the oliver-kriska/claude-elixir-phoenix repository on GitHub. Run ad-hoc PostgreSQL analytics queries against dev/test database
How do I install Psql Query in Claude Code?
Download psql-query.md from the repository. Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md. Run it by typing / followed by its name.
Can I use Psql Query in Claude Cowork?
Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it. In Customize → Skills, click +, then upload the ZIP. Run it from any task with / and the skill name.
Is Psql Query safe to install?
It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.
Similar resources
- Techdebt Find and report technical debt in the codebase Slash Command · oliver-kriska/claude-elixir-phoenix
- Testing Reviewer Reviews test code for Elixir best practices - ExUnit patterns, Mox usage, LiveView testing, factory patterns. Use proactively after writing tests or during code review. Subagent · oliver-kriska/claude-elixir-phoenix
- Web Researcher Fetches and extracts information from web sources efficiently. Optimized for ElixirForum, HexDocs, and GitHub. Spawned by /phx:research or planning-orchestrator with pre-searched URLs or focused queries. Subagent · oliver-kriska/claude-elixir-phoenix
- Verification Runner Run project-aware verification loop. Reads mix.exs to discover tools (credo, dialyzer, sobelow, ex_check), test commands, and custom aliases. Use proactively after code changes. Subagent · oliver-kriska/claude-elixir-phoenix
- Spec Load Load specs and lessons for current context Slash Command · catlog22/maestro-flow
- OCR: Address Feedback Address code review feedback — corroborate, validate, and implement changes from a review's final.md. Slash Command · spencermarx/open-code-review
- Spec Add Add spec entry by category with role tagging Slash Command · catlog22/maestro-flow
- OCR: Create Reviewer Create a new custom reviewer from a natural language description. Slash Command · spencermarx/open-code-review