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
| Component | Technology |
|---|---|
| Runtime | Node.js 18 |
| Framework | Express 4 |
| PostgreSQL Client | pg (node-postgres) |
| MariaDB/MySQL Client | mariadb |
| API Docs | swagger-ui-express (/api-docs) |
Full endpoint, header, and data type normalization details are on the Technical page.
How It Works
- The caller sends a request with
x-db-mode,x-db-host,x-db-port,x-db-user,x-db-password,x-db-nameheaders. - 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. - The query runs (
GET /tablesfor schema,POST /executefor a raw query), and the result is normalized (BigInt/Date/Buffer converted into JSON-safe types). - 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.