Skip to content
Documentation

Documentation

Everything you need to connect a database, ask questions, audit the generated SQL, and embed EasySQL in your own product.

Introduction

EasySQL is an AI layer between you and your database. You ask a question in natural language — EasySQL generates the SQL, runs the query (SELECT only), and returns the answer in natural language plus a table and a chart.

We support MySQL 5.7+, MariaDB 10.3+, and PostgreSQL 11+.


Connecting a DB

The fastest way is through the web dashboard: app.easysql.net. You will need:

  • Database host and port (e.g., db.example.com:3306)
  • Username and password — we recommend creating a read-only user
  • TLS access (recommended) or a publicly reachable connection

You can also connect via the API:

POST /v1/databases
{
  "name": "shop_wp",
  "type": "mysql",
  "host": "db.example.com",
  "port": 3306,
  "database": "wordpress",
  "username": "easysql_ro",
  "password": "••••••••",
  "ssl": true
}

Asking questions

Once connected, just ask. Examples of good questions:

  • "How many orders this month?"
  • "Which product sold the most this week?"
  • "Show me the top 10 customers by spend"
  • "How many users signed up this quarter?"

The more context you provide, the better the answer. You can ask for a specific chart ("as a bar chart") or filters ("only paid orders").


Generated SQL

Every generated SQL statement is shown in the answer. You can copy, audit, and even edit it before re-running. We only execute SELECT — any attempt at INSERT, UPDATE, DELETE, or DROP is rejected.

SELECT COUNT(*)
  FROM orders
 WHERE created_at BETWEEN '2026-05-01' AND '2026-05-31';

Charts and exports

EasySQL automatically picks the best chart (bar, line, pie) based on the result type. You can also ask for a specific chart explicitly.

Starter plans and above support CSV and JSON export.


Security

  • Read-only: we only run SELECT, with a 30s timeout.
  • TLS 1.3: all communication is encrypted.
  • No data storage: we only save the schema, never the values from your tables.
  • Auditing: every generated SQL is logged and available in the dashboard.

API & SDKs

The entire EasySQL UI is built on top of the public API. You can integrate directly:

Asking a question

POST /v1/query
{
  "database_id": "ds_8f3a",
  "question": "How many orders this month?",
  "language": "en-US"
}

Response

{
  "answer": "You received 148 orders in May.",
  "sql": "SELECT COUNT(*) FROM orders WHERE created_at BETWEEN '2026-05-01' AND '2026-05-31';",
  "rows": [{ "count": 148 }],
  "chart": { "type": "number", "value": 148, "delta_pct": 23 },
  "duration_ms": 1842
}

We have official SDKs for TypeScript / Node.js and PHP (both MIT). Coming soon: Python.

Ready to try it on your own data?

Connect a database in 2 minutes. 100 questions/month free, no credit card.