A Typeful Integration of SQL into Curry
Michael Hanus (CAU Kiel), Julia Krone (CAU Kiel)

TL;DR
This paper extends the Curry programming language with a type-safe SQL integration that ensures compile-time error detection and high-level database access, leveraging ER models for improved safety.
Contribution
It introduces a type-safe SQL extension for Curry that preprocesses SQL at compile time, preventing runtime errors and simplifying database interactions.
Findings
Type-safe SQL integration in Curry reduces runtime errors.
Preprocessing SQL statements enables compile-time type checking.
ER models facilitate high-level, safe database access.
Abstract
We present an extension of the declarative programming language Curry to support the access to data stored in relational databases via SQL. Since Curry is statically typed, our emphasis on this SQL integration is on type safety. Our extension respects the type system of Curry so that run-time errors due to ill-typed data are avoided. This is obtained by preprocessing SQL statements at compile time and translating them into type-safe database access operations. As a consequence, the type checker of the Curry system can spot type errors in SQL statements at compile time. To generate appropriately typed access operations, the preprocessor uses an entity-relationship (ER) model describing the structure of the relational data. In addition to standard SQL, SQL statements embedded in Curry can include program expressions and also relationships specified in the ER model. The latter feature is…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
