VirtuProbe Studio
Download
← All posts
Build log 5 July 2026 9 min read

Why a request workbench added a database.

When I wrote this, eight of VirtuProbe's protocols were client stacks written from scratch against the RFC, so nothing sat between what you intend to send and what is sent. MySQL was the ninth and the only one that wasn't (it is a thin layer over a JDBC driver and a connection pool).

For most of the tool's life the protocol list was HTTP, SMTP, IMAP, LDAP, DNS, SpamAssassin, SMB and Kerberos, all of them stacks where you control every byte.

A database doesn't fit that shape. When it climbed to the top of the backlog it raised two questions. Does a request workbench even need a database? And if it does, do we build it from the protocol up like everything else?

What a database is for in a request workbench

Take the most ordinary integration test there is, a POST that's supposed to create a user. The API returns 201 with a tidy {"status":"created"} and the test goes green on that response.

But the response only reports what the handler intended. The row can fail to land in ways that never touch the payload you asserted on: a transaction rolled back after the handler returned, an async worker that took the job and died, a write that went to the wrong shard, a constraint swallowed three layers down. Only the database knows whether the user exists. Until MySQL arrived, checking it meant leaving the tool for a SQL client and pasting the id in by hand.

So the database belongs at the end of a chain: fire the HTTP request, pull the new id out of the response with an extractor, run SELECT … WHERE id = {{userId}} and assert on the row.

Why not a hand-written stack

A database server can be fuzzed like any other. Its connection handshake, its auth plugins and its packet parser are C and C++ code, with the same memory-safety bugs that code has everywhere else.

The decision came down to what adding a protocol costs, which splits into two unequal halves. Standing up the module is cheap, because a Maven archetype scaffolds a new protocol in minutes (the wiring, the probe UI, the chain-step executor, the extractor plumbing, all generated and ready to fill in).

The expensive half is the client stack underneath, the from-scratch implementation of the protocol itself. For each of the eight that was weeks of careful work, which those probes need because they exist to control the exact bytes. MySQL's protocol is no smaller: a multi-step handshake, a spread of pluggable auth methods, prepared statements, a binary result-set encoding. Re-deriving all of it would have taken a month or more, only to end up with a client that handles connections and pooling worse than the mature driver that already exists.

And this isn't a solo weekend project anymore. There's a real user base with a concrete backlog. Against that backlog, a month spent reimplementing a protocol for byte-level control I expected few users to reach for, when a solid driver gives everyone the querying this week, wasn't a close call. Writing a stack from scratch was always a means to one end (send exactly what I ask), so I pay the weeks where that end matters and use a driver where it doesn't.

What we wrote: a thin layer over the driver

So MySQL is backed by MariaDB Connector/J, pooled with HikariCP. The URL is jdbc:mariadb://…, one driver that speaks to both MySQL and MariaDB, so we cover both engines without a second stack. We didn't fork or patch the driver. The design work went into three small classes that wrap it so it behaves like a VirtuProbe probe:

  • A connection config that is immutable and does two jobs: it renders the jdbc:mariadb:// URL plus a map of driver properties and computes a stable signature string from every field that affects the connection.
  • A pool that holds one HikariCP data source per distinct signature, in a concurrent map. Repeated sends and the steps of a chain borrow from the existing pool instead of paying a fresh TCP-plus-handshake each time.
  • A client that wraps a single borrowed connection, runs exactly one statement, maps the outcome and hands the connection back to the pool on close.

The signature deliberately includes the credentials, so changing a password spins up a fresh pool rather than silently reusing a data source configured with the old auth. Pooling also has a limitation: consecutive calls borrow a connection from the pool, not necessarily the same physical one. So session-scoped state (a temp table, a @variable, a USE) is not guaranteed to survive from one chain step to the next. A pinned-session mode, where a chain holds one connection for its whole run, is on the list and isn't in yet, so for now keep the state in the SQL rather than in the session.

A rejected statement comes back as a result

When the server rejects a statement, whether that is a syntax error, a constraint violation or a permission denial, the driver throws a SQLException. The obvious thing would have been to let that propagate as a failure. We catch it instead and map it into a normal result object with success = false plus the vendor errorCode, the SQLSTATE and the message filled in. A connection-level failure is handled separately and also comes back as a failed probe result.

The reasoning is the same one that governs the HTTP probe, where a 500 from the target is data you want, not an error in the tool. In a testing tool a constraint violation is frequently the expected outcome: you're asserting the duplicate insert gets rejected, that the NOT NULL holds. Thrown as an exception, that rejection would have left the test nothing to assert on.

Why results are untyped

Every cell is captured through getString, with a SQL NULL kept as a real null, which gives up rich per-type values. In return the result serializes to JSON trivially, compares directly in an ASSERT step and renders in one result table with no per-type branching. It also lets a query result flow through the same extractor-and-variable machinery every other protocol uses, so a number that arrives as "42" compares fine against an expected 42.

Getting values out of a result set

The result set is turned into chainable values by a handful of extractors. The primary one pulls a single cell, with a small expression grammar:

# MYSQL_COLUMN expressions email → column "email" of the first row 0.email → column "email" of row 0 2.status → column "status" of row 2 0.1 → the 2nd column of row 0, by index

Column names match case-insensitively, so email finds a column the query returned as EMAIL. Alongside MYSQL_COLUMN there are MYSQL_ROW_COUNT, MYSQL_AFFECTED_ROWS, MYSQL_SUCCESS, MYSQL_ERROR_CODE and MYSQL_JSON, which serializes the whole result set to a JSON array for the cases where you want to hand it to a script or a later step wholesale.

In a chain, {{variables}} are resolved straight into the SQL text before it runs, for two reasons. Cross-step chaining depends on it, since the id from an HTTP response lands in the WHERE clause. It also makes the probe usable for SQL-injection testing, where building a deliberately hostile query is the entire exercise.

Why the auth flags are off by default

MySQL 8 defaults its accounts to the caching_sha2_password plugin. Over a plaintext connection the driver needs the server's RSA public key to send credentials safely. Without it the first connection fails with "RSA public key is not available client side", which is the driver refusing to do something unsafe rather than a bug.

The fix is a single connection property that lets the driver fetch that key from the server over the same plaintext connection. We keep it off by default, exposed as a labeled checkbox, because a man-in-the-middle can answer with its own key and then decrypt the password. Turning on TLS removes the problem altogether. The other connection options are just as explicit:

  • TLS mode offers exactly the driver's four settings: off, encrypt-without-verifying, verify the certificate chain or verify the certificate chain and the hostname.
  • Cleartext auth plugins (the ones used with PAM or LDAP backends) send the password in the clear, so they are gated behind an explicit opt-in as well.
  • Extra properties is a free-form field, applied last, that can override anything above for a connection setting we didn't anticipate.

Two ways of building a protocol

Since this was written VirtuProbe has grown to sixteen protocols. PostgreSQL, SQL Server and MongoDB went through drivers the same way MySQL did, while Redis, FTP and STOMP got stacks written by hand. The sixteenth is Freestyle, a TCP or UDP exchange you compose yourself.

The HTTP probe, request chaining and the built-in AI assistant are free forever. VirtuProbe runs locally on macOS, Linux or Windows, with no account needed for the free tier. MySQL and the other database and integration protocols are part of the Engineering tier, while raw byte-level HTTP sends are Security.