rookie_text2data  by jaguarliuu

Natural language to SQL query generation tool

Created 10 months ago
257 stars

Top 98.3% on SourcePulse

GitHubView on GitHub
Project Summary

A Dify plugin that translates natural language queries into secure SQL statements for various databases. It targets developers and users who need to interact with databases without writing raw SQL, offering a secure and efficient way to retrieve data. The primary benefit is democratizing database access through natural language interfaces.

How It Works

The tool leverages Large Language Models (LLMs) to interpret natural language input and generate SQL queries. It supports seven database types, automatically adapting SQL syntax and schema awareness for each. Crucially, it incorporates robust security measures, including mandatory result set limits, a prohibition on DML operations (enforcing SELECT only), and field whitelist validation, to prevent unauthorized data access or modification.

Quick Start & Requirements

  • Installation: Requires importing the rookie_text2data plugin into Dify.
  • Prerequisites:
    • Access to one of the supported databases: MySQL, PostgreSQL, Oracle, SQL Server, GaussDB, KingbaseES, or DM.
    • A compatible LLM (e.g., Qwen-max, ChatGLM-6B, DeepSeek V3; deep-thinking models are unsupported).
  • Configuration: Requires database connection details (host, port, db_name, username, password) and the natural language query.
  • Links: No specific quick-start or demo links are provided in the README, but it's presented as a Dify plugin.

Highlighted Details

  • Broad Database Support: Natively supports 7 database types, including international (MySQL, PostgreSQL, Oracle, SQL Server) and Chinese domestic (GaussDB, KingbaseES, DM) systems, with automatic syntax adaptation.
  • Security First: Implements mandatory result set limits (default 100, configurable), DML operation prohibition (SELECT only), and field whitelist validation to ensure secure data retrieval.
  • Schema Awareness: Generates schema-aware queries for databases that support schemas, improving query accuracy.

Maintenance & Community

The README mentions gratitude for interest and feedback, suggesting an experimental project. It invites users to join a WeChat group for discussions. No specific details on core maintainers, sponsorships, or a public roadmap are provided.

Licensing & Compatibility

  • License: Apache License 2.0.
  • Compatibility: Permissive license suitable for commercial use and integration into closed-source applications.

Limitations & Caveats

The project is described as experimental. Deep-thinking LLMs are explicitly unsupported. Configuration requires detailed database credentials and LLM setup. No specific performance benchmarks or detailed setup time estimates are provided.

Health Check
Last Commit

2 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
2
Star History
10 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems") and Andreas Jansson Andreas Jansson(Cofounder of Replicate).

natural-sql by cfahlgren1

0%
867
Text-to-SQL LLMs with strong performance
Created 2 years ago
Updated 1 year ago
Feedback? Help us improve.