Skip to content

mohdwajid07/SNQL_to_SQL_parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SNQL to SQL Parser A simple and extensible SNQL (Simple Natural Query Language) to SQL parser built using Python. This project allows users to write human-readable queries in SNQL and convert them into standard SQL queries.

πŸš€ Features Convert SNQL queries to SQL queries

Supports basic SQL operations: SELECT, WHERE, ORDER BY, LIMIT, etc.

Modular and easy to extend

Written in clean and readable Python code

πŸ› οΈ Technologies Used Python 3.x

re module for regex-based parsing

CLI support (optional)

Optional: Flask (for API version)

πŸ“¦ Installation Clone the repository:

bash Copy Edit git clone https://github.com/yourusername/snql-to-sql-parser.git cd snql-to-sql-parser (Optional) Create and activate a virtual environment:

bash Copy Edit python -m venv venv source venv/bin/activate # On Windows use venv\Scripts\activate Install dependencies (if any):

bash Copy Edit pip install -r requirements.txt 🧠 SNQL Syntax Examples SNQL SQL get name, age from users SELECT name, age FROM users; get * from orders where price > 100 SELECT * FROM orders WHERE price > 100; get id from logs order by date desc limit 5 SELECT id FROM logs ORDER BY date DESC LIMIT 5; πŸ”§ Usage As a Python script python Copy Edit from snql_parser import parse_snql

snql_query = "get name, age from users where age > 25" sql_query = parse_snql(snql_query) print(sql_query) Output: pgsql Copy Edit SELECT name, age FROM users WHERE age > 25; πŸ§ͺ Running Tests bash Copy Edit python -m unittest discover tests πŸ“‚ Project Structure pgsql Copy Edit snql-to-sql-parser/ β”‚ β”œβ”€β”€ snql_parser.py # Core logic for SNQL to SQL conversion β”œβ”€β”€ app.py # (Optional) Flask API interface β”œβ”€β”€ tests/ β”‚ └── test_snql_parser.py β”œβ”€β”€ requirements.txt └── README.md 🚧 Future Improvements Add support for JOIN operations

Natural language enhancements (e.g., β€œshow me”, β€œlist all”)

GUI or web-based interface

Voice command to SNQL integration

πŸ™Œ Contributing Contributions, issues, and feature requests are welcome! Feel free to open a pull request or issue.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages