/ SONDA · BUILD

The API that is not there yet, and the database that already is.

An Echo answers at echo://name/path instead of a real API — from a data set that remembers what you posted, from a body with placeholders, from a script, or from a flow. A database becomes endpoints at sonda://name/path that any request calls, with every value bound and a switch that makes it read-only for real.

ECHO ON A PORT OR IN-PROCESS MONGODB · MYSQL · POSTGRESQL · SQL SERVER READS-ONLY, ENFORCED

At a glance

EchoAnswered in-process for any request, or on a real port for this computer or the LAN, CORS open. A delay per Echo and per endpoint. The last 300 hits in a traffic log.
DataJSON arrays with a key field, live while Sonda runs: what a POST adds, the next GET finds. Rows from CSV or JSON. "Start over" resets to the saved text.
DatabasesPure-Go drivers for MongoDB, MySQL and MariaDB, PostgreSQL, SQL Server. Up to 5,000 rows, 60 seconds a run.
BoundValues are parameters, always. An object from the body is only taken whole with :json, so there is no operator injection.
ThemisBuilds an Echo on request: the data set, the endpoints, the start.
/ TWO ADDRESSES, ONE REQUEST

The caller never knows what answered.

A request to echo://name/path is sent like any other, from any project, and an Echo answers it — in-process, with no port at all, or on a real port where this computer and the LAN reach it, CORS open. Each Echo and each endpoint can take a delay, so the API that is not there yet answers as slowly as the real one will.

A request to sonda://name/path is answered by a database: no port is opened, the rows come back, and X-Sonda headers name the database, the endpoint and the statement that ran. Both are reached by ordinary requests of any project, sent like any other — "Try it" and "Add a request" build the call from the samples.

/ ECHO

Four ways an endpoint answers.

Method, a path with :id or {id}, declared parameters — then what comes back.

From data: plain REST over a data set.

GET lists with an exact-match filter on a field, GET /:id, POST, PUT, PATCH, DELETE. The data set is a JSON array with a key field, live while Sonda runs: what a POST adds, the next GET finds, and new keys are the next number or a UUID. Rows come from CSV or JSON, and "Start over" resets to the saved text.

With a body: the answer, written down.

A fixed status, headers and body, with placeholders, modifiers and defaults.

By script: the answer, computed.

JavaScript, Go or Python reading the request and the data, answering with sonda.answer. Fifty-nine snippets to start from.

By flow: the answer is what a flow ends with.

A local webhook: the caller waits while a flow runs — up to ten minutes — and gets what the flow ends with.

/ ON THE WIRE

A POST, the GET that finds it, and a write a database refuses.

Beside this, a few requests as the runner shows them. The first two go to an Echo answering from its data set: the POST adds a row and gets the next key, and the GET after it finds the row. The next two go to a database at sonda://: the GET gets the rows with the headers that say which statement ran and with which values, and the DELETE is refused with a 403 — the database is reads-only, and that is enforced, not promised.

Every hit on an Echo lands in its traffic log, the last 300 of them.

# an Echo named shop, answering from its products data set POST echo://shop/products {"name": "Lamp", "price": 42} 201 Created Location: /products/25 · X-Echo-Answer: data · 2 ms {"id": 25, "name": "Lamp", "price": 42} GET echo://shop/products/25 200 OK X-Echo-Endpoint: products · 1 ms {"id": 25, "name": "Lamp", "price": 42} # a PostgreSQL database named crm, reads-only, no port opened GET sonda://crm/customers?country=AR 200 OK X-Sonda-Database: crm · X-Sonda-Endpoint: customers X-Sonda-Statement: SELECT … WHERE country = $1 X-Sonda-Args: ["AR"] · 312 rows DELETE sonda://crm/customers/7 403 Forbidden a write, refused — the database is reads-only
Built fromBy hand. From a request's saved Example in one click. From a Discover capture, as "name mock". From the demo: a users data set and seven endpoints with a scripted login. By Themis, on request.
Used fromAny request in any project at echo://. "Try it" and "Add a request" build the call from the samples. Programs outside Sonda reach it on the port.
On a portIn-process for any request, with no port at all, or on a real port for this computer or the LAN, CORS open. A delay per Echo and per endpoint. The last 300 hits in a traffic log.
LoggedStarting an Echo on a port is one of the activity triggers an administrator can be mailed about.
/ DATABASES

A query becomes an endpoint.

No port is opened. Any request calls sonda://name/path and gets the rows, with X-Sonda headers naming the database, the endpoint and the statement.

An endpoint is a method, a path and typed parameters.

Parameters come from the body, the query, a header or the path, each typed — string, int, number, bool, objectId, date, json — with required, default and sample. SQL is one statement with bound values. MongoDB: find, findOne, aggregate, count, insert, update, delete, with projection, sort, limit and skip.

Values are parameters, always. An object from the body is only taken whole with :json, so there is no operator injection. Up to 5,000 rows, 60 seconds a run.

Reads-only is a switch, not a promise.

SQL: the statement is scanned and runs in a read-only transaction. MongoDB: write operations refused, and $out and $merge stages refused inside a pipeline. A write against a reads-only database is a 403.

The connection stays on this computer.

The string takes variables from the environment and globals, is masked in the window and scrubbed from error messages. Connect, Test in 15 seconds, Close. Nothing of it reaches the team store.

/ LOCKFLARE SONDA

Echo and databases, in the free edition.

Echo and databases, listed →