Introducing DataLang — Ask questions to your Database in Natural Language

Alexandro Martinez
3 min readJun 16, 2023

Set your data source, ask a question in natural language, and get an answer, SQL, and database rows.

DataLang is yet another AI (prompt engineering) tool that is set to change the way you interact with databases. I’m excited to introduce you to our platform that allows you to communicate with your database using natural language!

Try the live demo or watch the demo.

DataLang — Ask your data questions in natural language

Why DataLang?

Working with databases can be daunting, especially for non-technical team members. Even for those adept at writing SQL queries, it can sometimes be a time-consuming process. What if there was a tool that could understand your natural language questions and convert them into SQL queries? That’s where DataLang comes in.

What Can DataLang Do?

DataLang is designed to make database interaction intuitive and user-friendly. Here’s how it works:

  1. You set up your data source connection string.
  2. DataLang fetches all the schema tables and columns from your data source.
  3. You ask a question in natural language, such as “How many users signed up this month?”
  4. DataLang sends your question to GPT (OpenAI).
  5. GPT processes your question and generates an SQL query.
  6. The SQL query executes in your database.
  7. A natural language response is returned.

Security Measures

Credential Encryption

I understand the importance of data security. That’s why your data source credentials are encrypted before being stored in the DataLang database, and only decrypted before executing SQL. I use this method to encrypt/decrypt credentials.

Dangerous SQL Statements Prevention

My prompt engineering method uses 4 prompts:

  1. Understanding the end-user question
  2. Interpreting the DB schema + making sense of the question
  3. Crafting SQL statements (SELECT only)
  4. Final SQL safety check

In the 4 steps, the prompts make sure to throw an “Unsafe question” error if it identifies dangerous operations, such as INSERT, UPDATE, DELETE, ALTER, DROP…

API

Use your account API Keys to send questions in the following format:

Send a POST request to the Questions API

Pricing That Suits Your Needs

We offer different pricing plans to fit your needs and usage:

  • Hobby: 2,000 questions/month, 1 data source, and 1 user.
  • Growth: 5,000 questions/month, 3 data sources, 3 users, and API access.
  • Enterprise: 10,000 questions/month, 10 data sources, 10 users, API access, and priority support.

You can also ask for a quote to have it in a custom server, have more questions per month, or have a custom feature developed, contact us!

Try DataLang today!

I built this MVP with my SaaS framework SaasRock, so I’ll wait for user feedback before adding more features. I’m not doing the same mistake of over-engineering a product before actually having users 😅.

Subscribe to the newsletter for more!

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Alexandro Martinez
Alexandro Martinez

Written by Alexandro Martinez

Building SaasRock, The One-Man SaaS Framework built with Remix + Tailwind CSS

Responses (2)

Write a response

Hi Alexandro, we were building something similar but had problems with respect to accuracy and hallucinations.
Are there any video demos of your tool answering metric related questions from databases where the modelling is not to the highest standard.
Thanks !

Hello Alexandro,
Enjoyed reading your article.
My name is Germán, and I work with Accel.AI, a non-profit organization whose principal focus is integrating AI and Social Impact through consulting, workshops, and research on ethical AI development and…