arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1701.00631cs.PLcs.DB
收藏

SQL与Curry的典型集成

A Typeful Integration of SQL into Curry

Michael Hanus, Julia Krone

摘要:

我们提出了一个扩展的声明性程序设计语言咖喱,以支持通过SQL访问存储在关系数据库中的数据。由于Curry是静态类型的,因此我们对SQL集成的重点是类型安全。我们的扩展尊重Curry的类型系统,从而避免了由于不良类型数据而导致的运行时错误。这是通过在编译时预处理SQL语句并将其转换为类型安全的数据库访问操作来实现的。因此,Curry系统的类型检查器可以在编译时发现SQL语句中的类型错误。为了生成适当类型的访问操作,预处理器使用描述关系数据结构的实体关系(ER)模型。除了标准SQL之外,Curry中嵌入的SQL语句还可以包括程序表达式以及ER模型中指定的关系。后一个特性对于避免容易出错的外键使用非常有用。因此,我们的SQL集成支持对Curry程序中数据库的高级和类型安全访问。

英文摘要:

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 useful to avoid the error-prone use of foreign keys. As a result, our SQL integration supports a high-level and type-safe access to databases in Curry programs.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑