Your Database Is Already an API — You Just Don't Know It Yet

Your Database Is Already an API — You Just Don't Know It Yet

Published on: 2026-03-16

You have a backend task. It’s small. Maybe you need to fetch some rows from Postgres to populate a dropdown in your app, or expose a few query results to a spreadsheet, or let a teammate pull live data without giving them database access.

So you do what you always do. You spin up a tiny Express server. Or a FastAPI endpoint. Or a Next.js API route. You write the boilerplate, wire up the connection string, handle the JSON serialization, deploy it somewhere, then spend twenty minutes wondering why a three-line SQL query requires all of this.

WizQL has a feature called API Relay that skips all of it.


What API Relay Does

When WizQL is running, it starts a local HTTP server on any available port on your system. You enable the relay and send it a SQL query via URL, and it returns JSON. That’s the entire feature.

http://localhost:5050?q=SELECT id, name, email FROM users LIMIT 10

Hit that in your browser, in Postman, in curl, in a fetch() call — anywhere. You get back:

[
	{ "id": 1, "name": "Priya Mehta", "email": "priya@example.com" },
	{ "id": 2, "name": "James Wu", "email": "james@example.com" }
]

No server to write. No deployment. No authentication layer to set up. Your database is already running. WizQL just adds the HTTP interface.


The Use Cases That Actually Come Up

Prototyping without a backend. You are building a frontend and you need real data. Instead of mocking it or writing a stub server, point your fetch calls at localhost:5050 and query your actual dev database. When you’re ready for production, swap in a real endpoint. Until then, you ship faster.

Feeding dashboards and spreadsheets. Google Sheets, Retool, Metabase, Notion — most of these tools can consume a JSON endpoint. Point them at your API Relay URL and your dashboard stays live without any infrastructure in between.

Testing data in your app. You’re building a feature and you want to see how your app handles specific rows. Craft the exact SQL you need, hit the endpoint, see the result in context.

Quick scripts and automations. Shell scripts, Python scripts, cron jobs — anything that can make an HTTP request can now read from your database without needing a DB driver installed or a connection string configured separately.


Why This Matters More Than It Sounds

There are SaaS products that exist entirely to solve this problem. PostgREST turns a Postgres schema into a REST API. Hasura adds a GraphQL layer. Supabase wraps your database in an HTTP interface. These are real products with real teams and real pricing — often $20–50/month or more.

API Relay doesn’t replace those for production use cases. You wouldn’t expose localhost:5050 to the internet and call it your API layer. But for the 80% of times you reach for those tools during development, prototyping, or internal work — API Relay already does it, it’s already running, and it costs you nothing extra.

The insight is that most of the time, you don’t need a production API. You need a result, right now, from a database you’re already connected to.


How to Use It

API Relay is available in the WizQL app. Once activated:

  1. Open WizQL and connect to your database as normal
  2. API Relay starts automatically in the background on an available port.
  3. Query it from anywhere that speaks HTTP:
# curl
curl "http://localhost:5050?q=SELECT * FROM orders WHERE status='pending'"
// JavaScript
const res = await fetch('http://localhost:5050?q=SELECT count(*) FROM events');
const data = await res.json();
# Python
import requests
rows = requests.get("http://localhost:5050", params={"q": "SELECT * FROM products"}).json()

Results come back as a JSON array of objects, with column names as keys. Works with every database WizQL supports — PostgreSQL, MySQL, SQLite, MongoDB (via WizQL’s SQL-for-MongoDB layer), DuckDB, IBM DB2, and more.


The Honest Limitation

This is a local tool. localhost:5050 is only accessible from your machine, which is exactly what you want during development — you don’t want your dev database exposed to the world. For team-accessible or production endpoints, you’ll want a proper API layer.

But for solo development, internal tooling, prototyping, and the hundred small “I just need this data right now” moments in every project — API Relay removes a surprising amount of friction from your day.


Try It

Available on Windows, macOS (Intel and Apple Silicon), and Linux — 64-bit, both x86 and ARM.

If you’ve ever written a five-line Express server just to expose a SQL query, this one’s for you.


logo

WizQl

© 2026 Rohit Singh. All rights reserved