name: db-query description: Use this skill to run SQL queries against the jishono database. Trigger for requests like "query the database", "run a SQL query", "check the data", "look up rows", "count entries", or any task that requires reading from or writing to the PostgreSQL database. Supports both the local dev database (via Docker) and the prod database (on localhost:5433).
Database Query — jishono-backend
Run SQL queries against the jishono PostgreSQL database.
Connection details
Local dev database (default)
Accessed via the Docker postgres service. The local dev DB is exposed on localhost:5432.
docker compose exec -T postgres psql -U postgres -d jishono -c "<SQL>"
For multi-line or complex queries, use a heredoc:
docker compose exec -T postgres psql -U postgres -d jishono <<'SQL'
SELECT ...
FROM ...
WHERE ...;
SQL
Production database
The prod database is tunneled/available on localhost:5433. Use psql directly (not via Docker):
Source the .env.prod file first:
source /Users/pg/kode/jisho/jishono-backend/.env.prod && PGPASSWORD="$DB_PASS_ADMIN_NODE" psql -h localhost -p 5433 -U "$DB_USER_ADMIN_NODE" -d jishono -c "<SQL>"
Which database to use
- Default to local dev unless the user explicitly says "prod", "production", or "live".
- Always confirm before running write operations (INSERT, UPDATE, DELETE) on prod.
- SELECT queries on prod are safe to run without confirmation.
Useful tips
- Use
\xor--expandedfor wide result sets. - Use
LIMITon exploratory queries to avoid dumping huge tables. - For CSV output:
psql ... -A -F',' -c "SELECT ..." - The
-Tflag ondocker compose execis important to avoid TTY issues.
Key tables
oppslag— dictionary entries (lemma_id, oppslag, boy_tabell, etc.)definisjon— definitions linked to oppslag via lemma_idboyningtables —subst_boy,verb_boy,adj_boy,adv_boy,det_boy,pron_boybrukere— usersforslag— definition suggestionsoppslag_forslag— new entry suggestionsveggen_innlegg— community wall postspage_traffic— page visit tracking
Skills similaires
Expert Next.js App Router
Developpement
Un skill qui transforme Claude en expert Next.js App Router.
Claude CodeCursoradvanced
890
234
3,180
Générateur de README
Developpement
Crée des README.md professionnels et complets pour vos projets.
claudeCursorWindsurfbeginner
259
72
1,083
Rédacteur de Documentation API
Developpement
Génère de la documentation API complète au format OpenAPI/Swagger.
claudeCursorWindsurfintermediate
156
44
943