ORM Forge: A Natural Language To Django ORM Query Generator Using Large Language Models
Author :
Rajesh Chauhan, Akshay Bhardwaj, Vinay KumarJourna Name:
International Journal of Scientific Research & Engineering Trends Volume:
12 issue:4 Year:Volume-12-issue-4 Views : 22
Abstract:
Writing correct, idiomatic Django Object-Relational Mapper (ORM) code remains a lasting productivity bottleneck for developers, especially developers who are new to the framework or working against unfamiliar schemas. In this paper, we present ORM Forge, a Django web application that utilizes the Anthropic Claude large language model (LLM) to translate natural language descriptions into production-ready Django ORM queries, and describe an empirical evaluation of the underlying natural language to query translation task, based on a publicly available benchmark, distributed as a structured tabular dataset. Instead of reiterating the system overview, we reframe ORM Forge as a research problem in natural-language-to-structured-query (NL2Query) translation, contextualize it within the wider text-to-SQL literature, and perform a quantitative analysis of translation difficulty based on a stratified sample of 120 question-query pairs from a cross-domain text-to-SQL benchmark.Queries were categorized by structural complexity (single-table, join, aggregation, nested/subquery) and manually mapped to their idiomatic Django ORM equivalents to evaluate how readily each SQL construct translates into ORM syntax such as Q objects, F expressions, annotate(), select_related(), and prefetch_related(). The results show that single-table filter and simple join queries translate almost directly (over 90% direct mapping) while nested subqueries and multi-level aggregations require non-trivial restructuring. This confirms that the query complexity is the dominant factor of translation difficulty. These observations motivate the design choices made by ORM Forge: structured JSON output, schema-grounded prompting, and bounded multi-turn refinement, and set the stage for discussing the limitations and future extensions of LLM-assisted ORM tooling.
APA:Rajesh Chauhan, Akshay Bhardwaj, Vinay Kumar. (Volume-12, Issue-4 -(Year-Volume-12-issue-4)). ORM Forge: A Natural Language To Django ORM Query Generator Using Large Language Models. Retrieved from https://ijsret.com/wp-content/uploads/IJSRET_V12_issue4_116.pdf
Chicago:Rajesh Chauhan, Akshay Bhardwaj, Vinay Kumar. "ORM Forge: A Natural Language To Django ORM Query Generator Using Large Language Models" Example, Volume-12-issue-4-Year-Volume-12-issue-4-2395-566X. https://ijsret.com/wp-content/uploads/IJSRET_V12_issue4_116.pdf.