The DSH package

[Tags: bsd3, library, program]

This is a Haskell library for database-supported program execution. Using DSH, 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 The Flatter, the Better — Query Compilation Based on the Flattening Transformation. [1] is a recommended reading. The package includes a couple of examples that demonstrate how to use DSH.

The current release does not rely anymore on the loop-lifting compilation technique and 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.

To generate actual code for a relational backend, an additional backend package needs to be installed. Currently, the package dsh-sql on Hackage provides SQL code generation for PostgreSQL.

Please read the release notes in README.md.

1. http://db.inf.uni-tuebingen.de/publications/TheFlatter-theBetter-QueryCompilationBasedontheFlatteningTransformation.html

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


[Skip to ReadMe]

Properties

Versions0.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
Change logNone available
Dependenciesaeson (>=0.8), algebra-dag (>=0.1.1), ansi-wl-pprint (>=0.6.7.2), base (>=4.8 && <5), bytestring (>=0.10), containers (>=0.5), Decimal (>=0.4), dlist (>=0.7), either (>=4.0), hashable (>=1.2), HUnit (>=1.2), kure (>=2.16), mtl (>=2.1), process (>=1.2), QuickCheck (>=2.7), random (>=1.1), semigroups (>=0.16), template-haskell (>=2.9), test-framework (>=0.8), test-framework-hunit (>=0.3), test-framework-quickcheck2 (>=0.3), text (>=1.2), time (>=1.4), unordered-containers (>=0.2), vector (>=0.10) [details]
LicenseBSD3
AuthorAlexander Ulrich, George Giorgidze, Jeroen Weijers, Nils Schweinsberg
Maintaineralex@etc-network.de
StabilityExperimental
CategoryDatabase
Source repositoryhead: git clone https://github.com/ulricha/dsh
Executablesvldot
UploadedWed Jun 3 19:29:20 UTC 2015 by AlexUlrich2
DistributionsNixOS:0.12.0.1
Downloads6832 total (347 in last 30 days)
Votes
0 []
StatusDocs not available [build log]
All reported builds failed as of 2015-06-08 [all 1 reports]

Modules

Flags

NameDescriptionDefaultType
debugcompPrint debugging information for comprehension rewritesDisabledAutomatic
debuggraphPrint debugging information for graph rewritesDisabledAutomatic

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

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for DSH-0.12.0.1

Database-Supported Haskell (DSH)

This is a Haskell library for database-supported program execution. Using DSH, 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 "The Flatter, the Better — Query Compilation Based on the Flattening Transformation." [1] is a recommended reading. The package includes a couple of examples that demonstrate how to use DSH.

The current release does not rely anymore on the loop-lifting compilation technique and 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.

To generate actual code for a relational backend, an additional backend package needs to be installed. Currently, the package dsh-sql on Hackage provides SQL code generation for PostgreSQL.

  1. Ulrich, Grust. The Flatter, the Better - Query Compilation Based on the Flattening Transformation. Proc. SIGMOD 2015.
  2. Grust et al. Bringing Back Monad Comprehensions. Haskell Symposium 2011.

Release Notes