• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / supavisor / 17412897580
65%

Build:
DEFAULT BRANCH: main
Ran 02 Sep 2025 06:51PM UTC
Jobs 2
Files 67
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

02 Sep 2025 06:42PM UTC coverage: 61.848% (+3.5%) from 58.388%
17412897580

push

github

web-flow
feat: improved named prepared statements support (#694)

Adds support for Prepared Statements through the Extended Query
Protocol.

### Concept
This PR implements the following architecture:
- ClientHandlers keep track of the prepared statements sent on them
- ClientHandlers update the prepared statement packets changing the
statement names to "internal names" (this is necessary because clients
may reuse the names in different connections)
- Prepared statement packets aren't sent directly to the db socket, but
instead are sent to the DbHandler. Whenever the ClientHandler sends a
`bind` packet to the DbHandler, it should also send the respective
`parse` (which it has stored)
- DbHandler decides whether it needs to run "parse" or just "bind"
- DbHandler must intercept "parse" responses when the client didn't
request them/it was made due to necessity
- DbHandler injects "parse" responses when the client requested a parse
but it's not necessary

### Parsing/decoding
- To be able to handle the prepared statement packets, ClientHandlers
need to peek at every client packet (at least on transaction mode)
- To be able to intercept parse responses, DbHandler needs to peek at
every server packet.
- For both ClientHandler and DbHandler, we can avoid decoding the whole
payload/decode only what's necessary (generally, we only need tagging,
except for the prepared statement payloads from which we need more
data).
- The decoding means more CPU usage, and it could also mean that we will
need to optimize the decoding routines a bit further.

### Limits
- ClientHandlers and DbHandler have separate limits
- If trespassing a ClientHandler limit, an error is returned and the
connection is closed
- If trespassing the DbHandler limit, a clean-up is triggered and a
random set of prepared statements is dropped. This is transparent to the
client. The only consequence for them is that some of their queries may
need to be re-prepared.
- ClientHandler has a memory limit. Every cli... (continued)

356 of 438 new or added lines in 17 files covered. (81.28%)

14 existing lines in 4 files now uncovered.

1553 of 2511 relevant lines covered (61.85%)

5472.08 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
93.33
lib/supavisor/protocol/prepared_statements/storage.ex
2
66.67
lib/supavisor/protocol/simple_query_handler.ex
3
93.75
lib/supavisor/protocol/prepared_statements.ex
5
46.55
-2.1% lib/supavisor/helpers.ex
6
74.04
6.58% lib/supavisor/db_handler.ex
6
95.74
-4.26% lib/supavisor/protocol/server.ex
9
71.54
1.27% lib/supavisor/client_handler.ex
12
13.33
-14.97% lib/supavisor/protocol/client.ex
38
73.79
lib/supavisor/protocol/debug.ex

Uncovered Existing Lines

Lines Coverage ∆ File
1
70.31
-0.78% lib/supavisor.ex
2
0.0
-66.67% lib/supavisor/pg_parser.ex
3
74.04
6.58% lib/supavisor/db_handler.ex
8
13.33
-14.97% lib/supavisor/protocol/client.ex
Jobs
ID Job ID Ran Files Coverage
1 run-tests - 17412897580.1 02 Sep 2025 06:51PM UTC 67
58.22
GitHub Action Run
2 run-integration - 17412897580.2 02 Sep 2025 06:56PM UTC 67
44.01
GitHub Action Run
Source Files on build 17412897580
  • Tree
  • List 67
  • Changed 13
  • Source Changed 10
  • Coverage Changed 13
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #17412897580
  • c75ca58f on github
  • Prev Build on main (#17307760804)
  • Next Build on main (#17443898625)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc