Skip to content

Commit 19380d7

Browse files
committed
chore: update docker/README.md with VS Code Dev Container Debugging instructions
1 parent 5c63ef4 commit 19380d7

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

docker/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,38 @@ Access pgAdmin at http://localhost:5050:
7373
- Email: `admin@cloudsync.local`
7474
- Password: `admin`
7575

76+
### VS Code Dev Container Debugging (PostgreSQL)
77+
78+
Use this when you want breakpoints in the extension code.
79+
The dev container uses `docker/postgresql/Dockerfile.debug` and `docker/postgresql/docker-compose.debug.yml`, which build the extension with debug symbols.
80+
Required VS Code extensions:
81+
- `ms-vscode-remote.remote-containers` (Dev Containers)
82+
- `ms-vscode.cpptools` (C/C++ debugging)
83+
84+
1) Open the dev container
85+
VS Code -> Command Palette -> `Dev Containers: Reopen in Container`
86+
87+
2) Connect with `psql` (inside the dev container)
88+
```bash
89+
psql -U postgres -d cloudsync_test
90+
```
91+
92+
3) Enable the extension if needed
93+
```sql
94+
CREATE EXTENSION IF NOT EXISTS cloudsync;
95+
```
96+
97+
4) Get the backend PID (inside `psql`)
98+
```sql
99+
SELECT pg_backend_pid();
100+
```
101+
102+
5) Attach the debugger (VS Code dev container window)
103+
Run and Debug -> `Attach to Postgres (gdb)` -> pick the PID from step 4 -> Continue
104+
105+
6) Trigger your breakpoint
106+
Run the SQL that exercises the code path. If `psql` blocks, the backend is paused at a breakpoint; continue in the debugger.
107+
76108
## Option 2: Supabase Integration
77109

78110
Use this for testing CloudSync with Supabase's full stack (auth, realtime, storage, etc.).

0 commit comments

Comments
 (0)