Initial commit from template
This commit is contained in:
55
.claude/skills/postgres-connect/SKILL.md
Normal file
55
.claude/skills/postgres-connect/SKILL.md
Normal file
@@ -0,0 +1,55 @@
|
||||
---
|
||||
name: postgres-connect
|
||||
description: Verbindet mit der PostgreSQL Datenbank. Erkennt das Betriebssystem, installiert psql CLI falls noetig, liest DATABASE_URL aus .env und stellt Verbindung her. Nutze diesen Skill wenn der User "Datenbank verbinden", "DB Verbindung", "psql", "PostgreSQL connect" oder aehnliches erwaehnt.
|
||||
---
|
||||
|
||||
# PostgreSQL Datenbank Verbindung
|
||||
|
||||
Dieser Skill verbindet automatisch mit der PostgreSQL Datenbank des Projekts.
|
||||
|
||||
## Automatischer Ablauf
|
||||
|
||||
1. **OS erkennen** mit dem Script `detect-os.sh`
|
||||
2. **psql pruefen** - ist PostgreSQL CLI installiert?
|
||||
3. **Falls nicht installiert** - Installation je nach OS
|
||||
4. **DATABASE_URL laden** aus `.env.local` oder `.env`
|
||||
5. **Verbindung herstellen** mit psql
|
||||
|
||||
## Scripts verwenden
|
||||
|
||||
### OS-Erkennung
|
||||
```bash
|
||||
bash detect-os.sh
|
||||
```
|
||||
|
||||
### psql Installation
|
||||
```bash
|
||||
bash install-psql.sh
|
||||
```
|
||||
|
||||
### Verbindung herstellen
|
||||
```bash
|
||||
bash connect.sh
|
||||
```
|
||||
|
||||
## Manuelle Befehle nach Verbindung
|
||||
|
||||
```sql
|
||||
-- Alle Tabellen anzeigen
|
||||
\dt
|
||||
|
||||
-- Tabellen-Schema
|
||||
\d table_name
|
||||
|
||||
-- Supabase Auth Users
|
||||
SELECT id, email, created_at FROM auth.users LIMIT 10;
|
||||
|
||||
-- RLS Policies pruefen
|
||||
SELECT * FROM pg_policies WHERE schemaname = 'public';
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- **Connection refused**: Supabase Projekt evtl. pausiert
|
||||
- **SSL required**: `?sslmode=require` an URL anhaengen
|
||||
- **Auth failed**: Passwort URL-encoded? (@ -> %40)
|
||||
Reference in New Issue
Block a user