elephants | hasql-th | |
---|---|---|
4 | 4 | |
23 | 110 | |
- | - | |
4.6 | 5.9 | |
7 months ago | 14 days ago | |
Haskell | Haskell | |
GNU General Public License v3.0 or later | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
elephants
-
How to use PostgreSQL with Haskell: hasql
💡 Remember that you can see the complete code in the repo.
-
How to use PostgreSQL with Haskell. Elephantine library review 2023
💡 If you want to follow allow at home, the repository contains all the imports and data types — we omit most of them from the tutorial for simplicity.
-
How to use PostgreSQL with Haskell: beam
All the other tables look quite similar; see the repo for the rest of the boilerplate. One interesting bit is foreign keys / referencing other primary keys; for example, product_id and category_id in the mapping table look like are defined as PrimaryKey ProductT f (not Columnar f Int64):
-
How to use PostgreSQL with Haskell: rel8
See the repo for the rest of the boilerplate.
hasql-th
-
How to use PostgreSQL with Haskell: hasql
Hasql is an ecosystem of libraries. To keep it simple, let’s limit ourselves to core hasql, hasql-transaction, and hasql-th. We’re using hasql 1.6.3.2 published in 2023.
-
Parsing SQL
unexpected '&'
https://github.com/nikita-volkov/hasql-th#error-example-1
-
Open Source SQL Parsers
There is also a Haskell port of the original PostgreSQL parser, implemented using megaparsec, which makes it highly flexible and hackable: https://github.com/nikita-volkov/hasql-th#implementation
-
Haskell doesn't make sense without pure functions
I'd consider hasql-th a good example in what concerns databases. Otherwise, I just use aeson together with deriving-aeson and lens-aeson.
What are some alternatives?
beam - A type-safe, non-TH Haskell SQL library and ORM
Neks - A dead simple networked key/value store
hasql-pool - A pool of connections for Hasql
tokyocabinet-haskell - This repository will get archived soon. Please visit https://git.singpolyma.net/tokyocabinet-haskell
contravariant-extras - Extras for the "contravariant" package
hasql - The fastest PostgreSQL libpq-based driver for Haskell
hasql-transaction - A composable abstraction over retriable transactions for Hasql
wai-middleware-cache-redis - Redis backend for wai-middleware-cache
profunctors - Haskell 98 Profunctors
ampersand - Build database applications faster than anyone else, and keep your data pollution free as a bonus.
hasql-notifications - Use PostgreSQL LISTEN/NOTIFY with your Hasql Types