ChatPaper.aiChatPaper

Automatisering van Database-Native Functiecode Synthese met LLM's

Automating Database-Native Function Code Synthesis with LLMs

April 2, 2026
Auteurs: Wei Zhou, Xuanhe Zhou, Qikang He, Guoliang Li, Bingsheng He, Quanqing Xu, Fan Wu
cs.AI

Samenvatting

Database systemen integreren een steeds groter aantal functies in hun kernels (ook wel database-native functies genoemd) voor scenario's zoals ondersteuning van nieuwe applicaties en bedrijfsmigratie. Deze groei veroorzaakt een dringende vraag naar automatische synthese van database-native functies. Hoewel recente vooruitgang in op LLM gebaseerde codegeneratie (bijv. Claude Code) veelbelovend is, zijn deze technieken te generiek voor databasespecifieke ontwikkeling. Ze hallucineren vaak of negeren kritieke context, omdat functiesynthese voor databases inherent complex en foutgevoelig is: het synthetiseren van een enkele functie kan het registreren van meerdere functie-eenheden, het koppelen van interne referenties en het correct implementeren van logica omvatten. Daarom stellen wij DBCooker voor, een op LLM gebaseerd systeem voor het automatisch synthetiseren van database-native functies. Het bestaat uit drie componenten. Ten eerste aggregeert de functiekarakteriseringsmodule declaraties uit meerdere bronnen, identificeert functie-eenheden die gespecialiseerde codering vereisen en traceert afhankelijkheden tussen eenheden. Ten tweede ontwerpen we operaties om de belangrijkste synthese-uitdagingen aan te pakken: (1) een op pseudocode gebaseerde generator van codeerplannen die gestructureerde implementatieskeletten construeert door belangrijke elementen zoals herbruikbare referentiefuncties te identificeren; (2) een hybride invulmodel, geleid door probabilistische prioriteiten en componentbewustzijn, om kernlogica te integreren met herbruikbare routines; en (3) drietraps progressieve validatie, inclusief syntaxiscontrole, naleving van standaarden en door LLM geleide semantische verificatie. Tot slot verenigt een adaptieve orkestratiestrategie deze operaties met bestaande tools en sequentieert ze dynamisch via de orkestratiegeschiedenis van vergelijkbare functies. Resultaten tonen aan dat DBCooker andere methoden overtreft op SQLite, PostgreSQL en DuckDB (gemiddeld 34,55% hogere nauwkeurigheid), en nieuwe functies kan synthetiseren die afwezig zijn in de nieuwste SQLite (v3.50).
English
Database systems incorporate an ever-growing number of functions in their kernels (a.k.a., database native functions) for scenarios like new application support and business migration. This growth causes an urgent demand for automatic database native function synthesis. While recent advances in LLM-based code generation (e.g., Claude Code) show promise, they are too generic for database-specific development. They often hallucinate or overlook critical context because database function synthesis is inherently complex and error-prone, where synthesizing a single function may involve registering multiple function units, linking internal references, and implementing logic correctly. To this end, we propose DBCooker, an LLM-based system for automatically synthesizing database native functions. It consists of three components. First, the function characterization module aggregates multi-source declarations, identifies function units that require specialized coding, and traces cross-unit dependencies. Second, we design operations to address the main synthesis challenges: (1) a pseudo-code-based coding plan generator that constructs structured implementation skeletons by identifying key elements such as reusable referenced functions; (2) a hybrid fill-in-the-blank model guided by probabilistic priors and component awareness to integrate core logic with reusable routines; and (3) three-level progressive validation, including syntax checking, standards compliance, and LLM-guided semantic verification. Finally, an adaptive orchestration strategy unifies these operations with existing tools and dynamically sequences them via the orchestration history of similar functions. Results show that DBCooker outperforms other methods on SQLite, PostgreSQL, and DuckDB (34.55% higher accuracy on average), and can synthesize new functions absent in the latest SQLite (v3.50).
PDF123April 13, 2026