mirror of
https://github.com/penpot/penpot.git
synced 2026-08-01 19:06:18 +00:00
Move all development tools from tools/ to scripts/ for consistency. Rename lint/fmt/check-fmt to lint-clj/fmt-clj/check-fmt-clj to clarify they target Clojure specifically. Remove unused scripts (attach-opencode, start-opencode, start-opencode-server) and the backport-commit skill. Update all internal references across .serena/, AGENTS.md, and CONTRIBUTING.md to point to the new script locations. Simplify CONTRIBUTING.md by delegating module-specific fmt/lint instructions to the respective serena memories. AI-assisted-by: deepseek-v4-flash
40 lines
1.1 KiB
Markdown
40 lines
1.1 KiB
Markdown
# Psql
|
|
|
|
`scripts/psql` is a wrapper around `psql` that connects to the Penpot PostgreSQL
|
|
database using environment variables (`PENPOT_DB_HOST`, `PENPOT_DB_USER`,
|
|
`PENPOT_DB_PASSWORD`, `PENPOT_DB_NAME`) with sensible defaults for local
|
|
development.
|
|
|
|
## When to use
|
|
|
|
- Running ad-hoc SQL queries against the Penpot database.
|
|
- Inspecting schema, migrations, or data during development or debugging.
|
|
|
|
## How to use (CLI)
|
|
|
|
```bash
|
|
# Default connection (penpot db, localhost)
|
|
scripts/psql -c "SELECT version();"
|
|
|
|
# Test database
|
|
scripts/psql --test -c "SELECT * FROM migrations;"
|
|
|
|
# Custom host/user/database
|
|
scripts/psql --host myhost --user myuser --db mydb
|
|
```
|
|
|
|
`scripts/psql` must be invoked from the repo root so the path resolves.
|
|
|
|
## Native Tool Available (opencode)
|
|
|
|
A native opencode tool `penpot-psql` is available. The LLM can call it directly
|
|
with:
|
|
- `sql`: SQL command string to execute
|
|
- `test`: Boolean flag to use the `penpot_test` database
|
|
|
|
Example usage by the LLM:
|
|
```
|
|
penpot-psql(sql="SELECT version();")
|
|
penpot-psql(sql="SELECT * FROM migrations;", test=true)
|
|
```
|