Static Integration of SQL Queries in C++ Programs

Autor: Bartosz Zieliński, Piotr Kruszyński, Maciej Sysak, Ścibor Sobieski, Paweł Maślanka
Rok vydání: 2014
Předmět:
Zdroj: Advances in Databases and Information Systems ISBN: 9783319109329
ADBIS
DOI: 10.1007/978-3-319-10933-6_10
Popis: Contemporary frameworks offer essentially two methods of accessing data in relational databases. The one using plain SQL requires writing a lot of boilerplate code and storing the SQL in a string, which is error prone and denies the benefits of static query analysis. The other one enforces the use of an additional (usually object oriented) abstraction layer which incurs additional runtime costs and hinders the use of advanced SQL capabilities. In this paper we present a working implementation of a radically different approach. Our tool uses the database engine to analyze the native SQL queries prepared by the user, and generates all the necessary classes representing query responses, single result rows and database connections. The use of native queries allows to utilize advanced and highly optimized SQL features. On the other hand, the use of the generated classes ensures that data access happens in a statically checked, type-safe way.
Databáze: OpenAIRE