Skip to content

Database Connect

Database Connect is RAGA's database proxy service, built on Node.js + Express. It accepts database connection parameters (host, port, user, password, database name) via HTTP headers on every request, forwards SQL queries to PostgreSQL or MariaDB/MySQL, and returns the results as JSON.

Database Connect is called by API Tarantula (env var DATABASE_CONNECT_URL) to execute queries for the Text-to-SQL feature — LLM-generated queries are run through this service against external databases configured by users at the workspace level.

Database Connect is stateless — no database configuration is stored in this service. All credentials are sent by the caller on every request and are never persisted.

Tech Stack

ComponentTechnology
RuntimeNode.js 18
FrameworkExpress 4
PostgreSQL Clientpg (node-postgres)
MariaDB/MySQL Clientmariadb
API Docsswagger-ui-express (/api-docs)

Full endpoint, header, and data type normalization details are on the Technical page.

How It Works

  1. The caller sends a request with x-db-mode, x-db-host, x-db-port, x-db-user, x-db-password, x-db-name headers.
  2. Database Connect opens a new connection per request (not a connection pool) to PostgreSQL or MariaDB/MySQL based on x-db-mode, with a 15-second timeout.
  3. The query runs (GET /tables for schema, POST /execute for a raw query), and the result is normalized (BigInt/Date/Buffer converted into JSON-safe types).
  4. The connection is closed immediately after the query completes.

Summary

Database Connect is a thin, stateless bridge between the RAGA engine and whichever external database a user has configured — deliberately generic by design (accepting per-request credentials rather than fixed configuration) so a single instance can serve many workspaces with different databases without a separate deployment per connection.