Metraipolis › archive › dc_e5cb41dd6f4f
AutoSQL: Extracting SQL Templates from Imperative ORM Code in Large-Scale Repositories — arXiv:2608.15595
- Source
- arXiv (en)
- Original
- https://arxiv.org/abs/2608.15595
- License (as archived)
- CC0-1.0
- Archived
- 2026-10-18T19:55:21.755Z
- SHA-256 of the archived text
3397127b11892ad57d4137b92c2fdf1d23160e690e522d61788af309c6acc9f6- Stable URL of this page
https://metraipolis.com/documento/dc_e5cb41dd6f4f
How to cite
AutoSQL: Extracting SQL Templates from Imperative ORM Code in Large-Scale Repositories — arXiv:2608.15595 — arXiv (en), https://arxiv.org/abs/2608.15595 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_e5cb41dd6f4f (Metraipolis archive dc_e5cb41dd6f4f, sha256 3397127b11892ad57d4137b92c2fdf1d23160e690e522d61788af309c6acc9f6)
BibTeX
@misc{dce5cb41dd6f4f,
title = {AutoSQL: Extracting SQL Templates from Imperative ORM Code in Large-Scale Repositories — arXiv:2608.15595},
howpublished = {arXiv (en)},
url = {https://arxiv.org/abs/2608.15595},
note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_e5cb41dd6f4f; sha256 3397127b11892ad57d4137b92c2fdf1d23160e690e522d61788af309c6acc9f6},
year = {2026}
}Archived text
Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2608.15595. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
Suboptimal SQL queries can significantly degrade the performance of cloud systems, motivating the extraction and auditing of SQL statements before deployment. However, Go ORM frameworks construct SQL imperatively through scattered method-call sequences, making it difficult to statically recover the resulting SQL templates. We present AutoSQL, a system that reconstructs SQL templates from Go ORM code. AutoSQL constructs a Code Index, a directed graph that captures structural dependencies between functions, types, and global variables as navigable edges. It then traces upstream call chains from ORM invocation sites to identify database-interacting functions as entry points. For each entry point, an LLM agent traverses the Code Index to collect code slices that influence SQL generation, switching to pattern-based search when the graph cannot resolve a retrieval goal. We call this strategy Hybrid Context Retrieval. Once sufficient context is collected, the agent synthesizes SQL templates. Evaluation on a benchmark of 579 test-covered entry points and 1,186 runtime-traced SQL statements from five large-scale Go repositories shows that AutoSQL achieves 68.04% to 72.18% recall, exceeding the static reachability baseline by 11.80% to 15.94% and outperforming existing methods by 8.52% to 21.50%. Tema degli esploratori: calcolo e infrastrutture (retro-catalogo arXiv: annunci del 2026-08-18 in cs.SE). Categorie arXiv: Software Engineering (cs.SE). Pagina del lavoro: https://arxiv.org/abs/2608.15595 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito). Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina. Letto il 2026-10-18T19:41:46.000Z dalla pagina https://arxiv.org/catchup/cs.SE/2026-08-18?abs=True (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).