Skip to content

text-sql is a tool that converts plain text instructions into SQL queries, simplifying database interactions. Ideal for developers and data analysts, it offers a user-friendly interface and robust functionality.

Notifications You must be signed in to change notification settings

ftchvs/text-sql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

text-sql

License: MIT Node.js npm

Welcome to text-sql! This tool helps you convert natural language text into SQL queries effortlessly. Whether you're a SQL novice or a seasoned developer, text-sql streamlines the process of database querying.

🚀 Features

  • 🧠 AI-Powered Conversion: Transform natural language queries into precise SQL statements using advanced AI models.
  • 🔄 Dual API Support: Choose between OpenAI's GPT and Anthropic's Claude for diverse AI capabilities.
  • 📊 Multi-Table Support: Handle complex database schemas with multiple tables and relationships.
  • 🔧 Dynamic Schema Input: Easily input and modify your database structure through the user interface.
  • 💻 User-Friendly Interface: Intuitive web-based UI for seamless interaction.
  • 🔒 Secure Backend: Node.js server ensuring safe handling of API requests and responses.
  • 📚 Educational Tool: Learn SQL through natural language interactions.

🎯 Use Cases

  • 📊 Data Analysis: Quickly generate SQL queries for data exploration and reporting.
  • 🎓 SQL Learning: Help students understand how natural language translates to SQL.
  • 💼 Business Intelligence: Enable non-technical users to query databases using familiar language.
  • 🧪 Prototyping: Rapidly prototype database queries for application development.
  • 🔍 Database Exploration: Easily explore and understand new or complex database schemas.

🖼️ Screenshot

Screenshot

🛠️ Installation

Prerequisites

  • Node.js (version 14.x or higher)
  • npm (version 6.x or higher)

Steps

  1. Clone the repository:
    git clone https://github.com/ftchvs/text-sql.git
  2. Navigate to the project directory:
    cd text-sql
  3. Install dependencies:
    npm install

Running the Application

To start the application, run:

npm start

The application will be available at http://localhost:3000.

📚 Usage

  1. Enter your query: Type a natural language query in the input box.
  2. Convert to SQL: Click the "Convert" button to generate the SQL query.
  3. Copy the SQL: Copy the generated SQL query for use in your database management system.

🔄 API Documentation

Endpoint: /api/convert

  • Method: POST
  • Description: Converts natural language to SQL.
  • Request:
    {
      "query": "Show me all users who signed up in the last month."
    }
  • Response:
    {
      "sql": "SELECT * FROM users WHERE signup_date >= NOW() - INTERVAL 1 MONTH;"
    }

❓ FAQ

Q1: How do I add a new event?

A1: Navigate to the 'Events' section and click on 'Add Event'. Fill in the required details and click 'Save'.

Q2: Can I use text-sql with any database?

A2: Yes, text-sql supports multiple database types. Ensure your database schema is correctly inputted in the 'Schema' section.

📜 Changelog

v1.0.0

  • Initial release with AI-powered SQL conversion, multi-table support, and dynamic schema input.

🤝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch:
    git checkout -b feature/your-feature-name
  3. Make your changes and commit them:
    git commit -m 'Add some feature'
  4. Push to the branch:
    git push origin feature/your-feature-name
  5. Open a pull request.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

📬 Contact

For any inquiries or support, please contact ftchvs.

About

text-sql is a tool that converts plain text instructions into SQL queries, simplifying database interactions. Ideal for developers and data analysts, it offers a user-friendly interface and robust functionality.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published