{"id":13616757,"url":"https://github.com/haskell-beam/beam","last_synced_at":"2025-05-14T05:10:39.547Z","repository":{"id":25733945,"uuid":"29171316","full_name":"haskell-beam/beam","owner":"haskell-beam","description":"A type-safe, non-TH Haskell SQL library and ORM","archived":false,"fork":false,"pushed_at":"2025-05-06T00:52:05.000Z","size":18048,"stargazers_count":595,"open_issues_count":125,"forks_count":173,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-05-06T01:35:54.008Z","etag":null,"topics":["haskell","orm","postgres","postgresql","sql","sqlite"],"latest_commit_sha":null,"homepage":"https://haskell-beam.github.io/beam/","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haskell-beam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-01-13T03:43:12.000Z","updated_at":"2025-05-06T00:52:09.000Z","dependencies_parsed_at":"2023-02-15T03:10:35.526Z","dependency_job_id":"f241a64f-fcfc-464e-9fc3-b587af306920","html_url":"https://github.com/haskell-beam/beam","commit_stats":{"total_commits":751,"total_committers":89,"mean_commits":8.438202247191011,"dds":0.6045272969374168,"last_synced_commit":"249cb07e106dfa8976b9cad96e5f261618855b27"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell-beam%2Fbeam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell-beam%2Fbeam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell-beam%2Fbeam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell-beam%2Fbeam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haskell-beam","download_url":"https://codeload.github.com/haskell-beam/beam/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254076850,"owners_count":22010611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["haskell","orm","postgres","postgresql","sql","sqlite"],"created_at":"2024-08-01T20:01:32.914Z","updated_at":"2025-05-14T05:10:39.520Z","avatar_url":"https://github.com/haskell-beam.png","language":"Haskell","readme":"# Beam: a type-safe, non-TH Haskell relational database library and ORM\n\n[![Build status](https://github.com/haskell-beam/beam/workflows/Build/badge.svg)](https://github.com/haskell-beam/beam/workflows/Build/badge.svg)\n[![Build status](https://github.com/haskell-beam/beam/actions/workflows/nix-flake.yaml/badge.svg)](https://github.com/haskell-beam/beam/actions/workflows/nix-flake.yaml)\n\nIf you use beam commercially, please consider a donation to make this project possible: https://liberapay.com/tathougies\n\nBeam is a Haskell interface to relational databases. Beam uses the Haskell type\nsystem to verify that queries are type-safe before sending them to the database\nserver. Queries are written in a straightforward, natural monadic syntax.\nCombinators are provided for all standard SQL92 features, and a significant\nsubset of SQL99, SQL2003, and SQL2008 features. For your convenience a thorough\ncompatibility matrix is\nmaintained [here](https://haskell-beam.github.io/beam/about/compatibility/).\n\nBeam is standards compliant but not naive. We recognize that different database\nbackends provide different guarantees, syntaxes, and advantages. To reflect\nthis, beam maintains a modular design. While the core package provides standard\nfunctionality, beam is split up into a variety of *backends* which provide a\nmeans to interface Beam's data query and update DSLs with particular RDBMS\nbackends. Backends can be written and maintained independently of this\nrepository. For example,\nthe [beam-mysql](https://github.com/tathougies/beam-mysql)\nand [beam-firebird](https://github.com/gibranrosa/beam-firebird) backends are\npackaged independently.\n\nRecognizing that over-abstraction frequently means caving in to the\nlowest common denominator, Beam does not do connection or transaction\nmanagement. Rather, the user is free to perform these functions using the\nappropriate Haskell interface library for their backend of choice. Additionally,\nbeam backends provide a significant portion of backend-specific functionality\nwhich seamlessly fits into the beam ecosystem.\n\nFor example, the `beam-postgres` backend is built off of the `postgresql-simple`\ninterface library. When using `beam-postgres`, the user manages connections and\ntransactions with `postgresql-simple`. The user is free to issue queries\ndirectly with `postgresql-simple`, only using beam when desired. Postgres offers\na number of rich data types on top of the standard SQL data types. To reflect\nthis, `beam-postgres` offers pluggable support for postgres-specific data types\nand features.\n\nFor more information, see the [user guide](https://haskell-beam.github.io/beam).\n\nFor questions, feel free to join\nour [mailing list](https://groups.google.com/forum/#!forum/beam-discussion) or\nhead over to `#haskell-beam` on freenode.\n\n## A word on testing\n\n`beam-core` has in-depth unit tests to test query generation over an idealized\nANSI SQL-compliant backend. You may be concerned that there are no tests in\neither `beam-sqlite` or `beam-postgres`. Do not be alarmed. The documentation\ncontains many, many examples of queries written over the sample Chinook\ndatabase, the schema for which can be found at\n`beam-sqlite/examples/Chinook/Schema.hs`. The included `mkdocs` configuration\nand custom `beam_query` python Markdown extension automatically run every query\nin the documentation against a live database connection. Any errors in\nserializion/deserialization or invalid syntax are caught while building the\ndocumentation. Feel free to open pull-requests with additional examples/tests.\n\nTests are written\n\n~~~markdown\n!beam-query\n```haskell\n!example \u003ctemplate-name\u003e \u003crequirements\u003e\ndo x \u003c- all_ (customer chinookDb) -- chinookDb available under chinook and chinookdml examples\n   pure x\n```\n~~~\n\nThe `!beam-query` declaration indicates this is markdown code block that\ncontains beam query code. The `!example` declaration indicates that this example\nshould be built against applicable backends and included in the code. The\n`template_name` is either `chinook` or `chinookdml` (depending on whether you\nhave quest a query or a DML statement). For `chinook`, the included code should\nproduce a `Q` query. For `chinookdml`, the included code should be a monadic\naction in a `MonadBeam`. The `requirements` can be used to select which backends\nto run this against. See the documentation for examples.\n\n## Building the documentation\n\nBeam uses [`mkdocs`](https://www.mkdocs.org/) for its documentation generation.\n\n### Requirements\n* Python installation with [`mkdocs` module](https://pypi.org/project/mkdocs/)\n* Alternatively, open the Nix Flake shell via `nix develop`.\n\nThen run `build-docs.sh`.\n\nTODO: define Nix package for docs bundle.\n\nThe documentation uses a custom Markdown preprocessor to automatically build\nexamples against the canonical Chinook database. By default, beam will build\nexamples for *every* beam backend it knows about, including ones not in the main\nsource tree (see `docs/beam.yaml` for the full configuration). This means you\nwill need to have an instance of all these database servers running and\navailable. This is usually not what you want.\n\nTo only build examples for a particular backend, modify `mkdocs.yaml` and set\nthe `enabled_backends` configuration setting for the `docs.markdown.beam_query`\npreprocessor. For example, to only build docs for `beam-sqlite`, change\n\n```yaml\n  - docs.markdown.beam_query:\n      template_dir: 'docs/beam-templates'\n      cache_dir: 'docs/.beam-query-cache'\n      conf: 'docs/beam.yaml'\n      base_dir: '.'\n```\n\nto\n\n```yaml\n  - docs.markdown.beam_query:\n      template_dir: 'docs/beam-templates'\n      cache_dir: 'docs/.beam-query-cache'\n      conf: 'docs/beam.yaml'\n      base_dir: '.'\n      enabled_backends:\n        - beam-sqlite\n```\n","funding_links":["https://liberapay.com/tathougies"],"categories":["Haskell"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaskell-beam%2Fbeam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaskell-beam%2Fbeam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaskell-beam%2Fbeam/lists"}