hasql-th
tree-sitter-sql
Our great sponsors
hasql-th | tree-sitter-sql | |
---|---|---|
4 | 6 | |
109 | 126 | |
- | - | |
5.2 | 8.7 | |
4 months ago | 15 days ago | |
Haskell | JavaScript | |
MIT License | 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.
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
-
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.
tree-sitter-sql
-
Parsing SQL with Rust
A complete grammar of the SQL language is rather large, as can be seen by this grammar https://github.com/DerekStride/tree-sitter-sql/blob/main/grammar.js that is 2000 lines of code.
-
Writing a SQL LS in Rust - Looking for Coding Companions.
Alternatively, you could use a tree-sitter parser, such as https://github.com/DerekStride/tree-sitter-sql , which would provide fast incremental parses (but may result in a less detailed AST).
- Treesitter Capturing ERROR Nodes
-
Open Source SQL Parsers
I'm using a tree-sitter grammar^1, which category the OP doesn't mention, to index database object references in data access code and process schema migrations^2. The idea is early detection of potentially-dangerous database changes that modify or drop tables/views still used elsewhere, across the entire organization's code. It's already saved my bacon a few times.
^1 specifically https://github.com/DerekStride/tree-sitter-sql , but there are a few others around too
What are some alternatives?
grammars-v4 - Grammars written for ANTLR v4; expectation that the grammars are free of actions.
Neks - A dead simple networked key/value store
tokyocabinet-haskell - This repository will get archived soon. Please visit https://git.singpolyma.net/tokyocabinet-haskell
hasql - The fastest PostgreSQL libpq-based driver for Haskell
wai-middleware-cache-redis - Redis backend for wai-middleware-cache
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
hasql-transaction - A composable abstraction over retriable transactions for Hasql
prql - PRQL is a modern language for transforming data — a simple, powerful, pipelined SQL replacement
hasql-cursor-query - A declarative abstraction over PostgreSQL Cursor
nvim-treesitter - Nvim Treesitter configurations and abstraction layer
duckdb - DuckDB is an in-process SQL OLAP Database Management System