The DSH package

[ Tags: bsd3, database, library, program ] [ Propose Tags ]

This is a Haskell library for database-supported program execution. Using this library a relational database management system (RDBMS) can be used as a coprocessor for the Haskell programming language, especially for those program fragments that carry out data-intensive and data-parallel computations.

Database executable program fragments can be written using the monad comprehension notation [2] and list processing combinators from the Haskell list prelude. Note that rather than embedding a relational language into Haskell, we turn idiomatic Haskell programs into SQL queries.

DSH faithfully represents list order and nesting, and compiles the list processing combinators into relational queries. The implementation avoids unnecessary data transfer and context switching between the database coprocessor and the Haskell runtime by ensuring that the number of generated relational queries is only determined by the program fragment's type and not by the database size.

DSH can be used to allow existing Haskell programs to operate on large scale data (e.g., larger than the available heap) or query existing database resident data with Haskell.

Note that this package is flagged experimental and therefore is not suited for production use (we mean it!). This is a proof of concept implementation only. To learn more about DSH, our paper entitled as "Haskell Boards the Ferry: Database-Supported Program Execution for Haskell" [1] is a recommended reading. The package includes a couple of examples that demonstrate how to use DSH.

In contrast to the DSH version described in [1], the current release does not rely anymore on the loop-lifting compilation technique together with the Pathfinder optimizer. Instead, it brings a completely rewritten query compiler based on Guy Blelloch's flattening transformation. This approach leads to a more robust compilation and produces more efficient query code.

Please read the release notes in README.md.

  1. http://db.inf.uni-tuebingen.de/staticfiles/publications/ferryhaskell.pdf

  2. http://db.inf.uni-tuebingen.de/staticfiles/publications/haskell2011.pdf


[Skip to Readme]

Properties

Versions 0.4, 0.4.0.1, 0.4.1, 0.4.2, 0.4.2.1, 0.4.3, 0.5, 0.5.3, 0.5.5, 0.6, 0.6.1, 0.6.2, 0.6.6, 0.7, 0.7.1, 0.7.2, 0.7.3, 0.7.4, 0.7.5, 0.7.6, 0.7.7, 0.7.8, 0.7.8.1, 0.7.8.2, 0.8.0.1, 0.8.1.0, 0.8.2.0, 0.8.2.1, 0.8.2.2, 0.8.2.3, 0.10.0.0, 0.10.0.1, 0.10.0.2, 0.12.0.0, 0.12.0.1
Dependencies aeson (>=0.8), algebra-dag (>=0.1), algebra-sql (>=0.1), ansi-wl-pprint (>=0.6), base (>=4.7 && <5), bytestring (>=0.10), containers (>=0.5), dlist (>=0.7), DSH, either (>=4.0), HDBC (>=2.3), HDBC-postgresql (>=2.3), kure (>=2.16), mtl (>=2.1), pretty (>=1.1), semigroups (>=0.16), set-monad (>=0.1), template-haskell (>=2.9), text (>=1.1) [details]
License BSD3
Author George Giorgidze, Alexander Ulrich, Nils Schweinsberg and Jeroen Weijers
Maintainer alex@etc-network.de
Category Database
Uploaded Sun Dec 14 22:04:30 UTC 2014 by AlexUlrich2
Distributions NixOS:0.12.0.1
Executables manual, vldot
Downloads 10030 total (51 in the last 30 days)
Rating 0.0 (0 ratings) [clear rating]
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2016-12-12 [all 7 reports]
Hackage Matrix CI

Modules

  • Database
    • Database.DSH
      • Database.DSH.Compiler

Flags

NameDescriptionDefaultType
debugcomp

Print debugging information for comprehension rewrites

DisabledAutomatic
debuggraph

Print debugging information for graph rewrites (VL, TA)

DisabledAutomatic

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for DSH-0.10.0.1

[back to package description]

Database-Supported Haskell (DSH)

This is a Haskell library for database-supported program execution. Using this library a relational database management system (RDBMS) can be used as a coprocessor for the Haskell programming language, especially for those program fragments that carry out data-intensive and data-parallel computations.

Database executable program fragments can be written using the monad comprehension notation [2] and list processing combinators from the Haskell list prelude. Note that rather than embedding a relational language into Haskell, we turn idiomatic Haskell programs into SQL queries.

DSH faithfully represents list order and nesting, and compiles the list processing combinators into relational queries. The implementation avoids unnecessary data transfer and context switching between the database coprocessor and the Haskell runtime by ensuring that the number of generated relational queries is only determined by the program fragment's type and not by the database size.

DSH can be used to allow existing Haskell programs to operate on large scale data (e.g., larger than the available heap) or query existing database resident data with Haskell.

Note that this package is flagged experimental and therefore is not suited for production use. This is a proof of concept implementation only. To learn more about DSH, our paper entitled as "Haskell Boards the Ferry: Database- Supported Program Execution for Haskell" [1] is a recommended reading. The package includes a couple of examples that demonstrate how to use DSH.

In contrast to the DSH version described in [1], the current release does not rely anymore on the loop-lifting compilation technique together with the Pathfinder optimizer. Instead, it brings a completely rewritten query compiler based on Guy Blelloch's flattening transformation. This approach leads to a more robust compilation and produces more efficient query code.

  1. [http://db.inf.uni-tuebingen.de/staticfiles/publications/ferryhaskell.pdf](Grust et al. Haskell Boards the Ferry. Database-Supported Program Execution for Haskell. IFL 2010)
  2. [http://db.inf.uni-tuebingen.de/staticfiles/publications/haskell2011.pdf](Grust et al. Bringing Back Monad Comprehensions. Haskell Symposium 2011).

Release Notes

  • This is an experimental proof-of-concept implementation that most likely contains bugs. You have been warned. We are happy to receive bug reports.
  • For documentation, have a look at the examples included in directory 'examples' in the source distribution.
  • DSH works with a HDBC PostgreSQL connection. Other databases (e.g. MySQL, Sqlite) are unlikely to work.
  • Support for general algebraic data types is currently broken. Flat record types do work.
  • Comprehension syntax for DSH queries is currently implemented using monad comprehensions and the RebindableSyntax extension. This means that any module that contains DSH queries and makes use of comprehension syntax has to enable the extension. Additionally, do-notation and comprehensions over other monads (e.g. lists) can not be used in such a module. This limitation is an implementation artifact that we hope to get rid of soon.