Performant PostgreSQL driver with a flexible mapping API
Go to file
Nikita Volkov 3129188ef6
Merge pull request #88 from felixonmars/patch-2
Allow tasty-quickcheck 0.10
2018-03-05 21:00:50 +03:00
benchmarks Update the benchmark 2017-10-09 18:44:11 +03:00
library/Hasql Migrate from EitherT to ExceptT 2017-11-26 11:24:40 +03:00
profiling Add profiling 2017-04-14 00:49:33 +03:00
tasty Migrate from EitherT to ExceptT 2017-11-26 11:24:40 +03:00
threads-test Add threads test 2016-03-06 13:54:42 +03:00
.travis.yml Fix the Travis config 2017-11-01 20:24:57 +03:00
hasql.cabal Allow tasty-quickcheck 0.10 2018-03-05 21:05:06 +08:00
LICENSE Init 2014-08-03 17:48:18 +04:00
profile-events Add profiling 2017-04-14 00:49:33 +03:00
README.md Update README.md 2016-08-18 08:03:26 +03:00

What Hasql is

Hasql is a highly efficient PostgreSQL driver and a mapping API. It targets both the users, who need a low level of abstraction, and the users, who face the typical tasks of DB-powered applications, providing them with higher-level APIs.

Ecosystem

Hasql is not just a single library, it is a granular ecosystem of composable libraries, each isolated to perform its own task and stay simple.

  • "hasql" - the root of the ecosystem, which provides the essential abstraction over the PostgreSQL client functionality and mapping of values. Everything revolves around that library.

  • "hasql-pool" - a Hasql-specialized abstraction over the connection pool.

  • "hasql-transaction" - an STM-inspired composable abstraction over the database transactions with the automated conflict resolution.

  • "hasql-cursor-query" - a declarative abstraction over cursors.

  • "hasql-cursor-transaction" - a lower-level abstraction over cursors, which however allows to fetch from multiple cursors simultaneously. Generally though "hasql-cursor-query" is the recommended alternative.

  • "hasql-th" - Template Haskell utilities, such as getting SQL from external files at compile-time. It's planned to extend this library to provide a compile-time checking of the SQL-syntax correctness.

  • "hasql-migration" - an abstraction over the migration strategies. Yet to be released.

  • "hasql-optparse-applicative" - "optparse-applicative" parsers for Hasql.

Benefits of being an ecosystem

  • Simplicity. Each library in isolation provides a simple API, which is trivial to comprehend.

  • Flexibility and composability. The user picks and chooses the features, thus precisely matching the level of abstraction that he needs for his task.

  • Much more stable and more descriptive semantic versioning. E.g., a change in the API of the "hasql-transaction" library won't affect any of the other libraries and it gives the user a more precise information about which part of his application he needs to update to conform.

  • Interchangeability and competition of the ecosystem components. E.g., not everyone will agree with the restrictive design decisions made in the "hasql-transaction" library. However those decisions are not imposed on the user, and instead of having endless debates about how to abstract over transactions, another extension library can simply be released, which will provide a different interpretation of what the abstraction over transactions should be.

  • Horizontal scalability of the ecosystem. Instead of posting feature- or pull-requests, the users are encouraged to release their own small extension-libraries, with themselves becoming the copyright owners and taking on the maintenance responsibilities. Compare this model to the classical one, where some core-team is responsible for everything. One is scalable, the other is not.


NOTICE

With the recent releases and more to come still, the Hasql ecosystem has undergone a major revision. It is now expected that the users will need a thorough introduction. Hence this notice is to inform you that the documentation with tutorials targeted at both the newcomers and the users who need to migrate from the older versions of the ecosystem are coming soon.