{"id":13566555,"url":"https://github.com/spartanz/schemaz","last_synced_at":"2026-01-16T17:08:16.702Z","repository":{"id":68540753,"uuid":"140141236","full_name":"spartanz/schemaz","owner":"spartanz","description":"A purely-functional library for defining type-safe schemas for algebraic data types, providing free generators, SQL queries, JSON codecs, binary codecs, and migration from this schema definition","archived":false,"fork":false,"pushed_at":"2020-01-28T10:36:26.000Z","size":1294,"stargazers_count":164,"open_issues_count":20,"forks_count":18,"subscribers_count":30,"default_branch":"prototyping","last_synced_at":"2024-04-09T10:35:38.776Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://spartanz.github.io/schemaz","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spartanz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-07-08T05:49:57.000Z","updated_at":"2024-04-02T17:43:41.000Z","dependencies_parsed_at":"2023-03-29T00:33:33.055Z","dependency_job_id":null,"html_url":"https://github.com/spartanz/schemaz","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spartanz%2Fschemaz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spartanz%2Fschemaz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spartanz%2Fschemaz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spartanz%2Fschemaz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spartanz","download_url":"https://codeload.github.com/spartanz/schemaz/tar.gz/refs/heads/prototyping","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":213527956,"owners_count":15600793,"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":[],"created_at":"2024-08-01T13:02:11.947Z","updated_at":"2026-01-16T17:08:16.696Z","avatar_url":"https://github.com/spartanz.png","language":"Scala","funding_links":[],"categories":["Scala"],"sub_categories":[],"readme":"# SchemaZ\n\n[![Gitter](https://badges.gitter.im/spartanz/schemaz.svg)](https://gitter.im/spartanz/schemaz?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n\n[![Build Status][build-image]][build-url] [![Coverage Status][coverage-image]][coverage-url]\n\n[build-image]: http://img.shields.io/travis/spartanz/schemaz/prototyping.svg\n[build-url]: https://travis-ci.org/spartanz/schemaz\n\n[coverage-image]: https://img.shields.io/codecov/c/github/spartanz/schemaz/prototyping.svg\n[coverage-url]: https://codecov.io/github/spartanz/schemaz?branch=prototyping\n\n## Goal\n\nA purely-functional library for defining type-safe schemas for algebraic data types, providing free generators, SQL queries, JSON codecs, binary codecs, and migration from this schema definition.\n\n## Introduction \u0026 Highlights\n\nSchemaZ defines a generic representation of algebraic data structures and combinators that turn such schema into a generic computation over arbitrary data. In other words, SchemaZ provides a way to express any computation that abstracts over the structure of data, such as:\n\n* Codecs: given a serial format (binary, JSON, etc.) and the schema of a data structure (say, an ADT) we can derive a codec for that data structure and serial format.\n* Data Generators: given any schema we can derive random data generators (eg. scalacheck's `Gen`) that produce data satisfying that schema.\n* Schema/Data Migrations: since schemas are values, we can easily verify whether two versions of a schema are forward/backward compatible and provide a generic way to upgrade/downgrade data from one version of the schema to the other.\n* Diffing/Patching: given a schema we can generically compute the difference between two pieces of data satisfying that schema. In the same spirit, we have generic way to apply patches to arbitrary data structures.\n* Queries: knowing a schema, we can produce SQL queries to interact with a database that holds an instance of (the SQL version of) that schema.\n\n\n## Competition\n\n\n | | codecs | generators | migrations | diff/patch | queries | \n ---|---|---|---|---|---\n xenomorph | ✓ | ✓ | ? | 𐄂 | 𐄂\n shapeless * | ✓ | ✓ | 𐄂 | ✓ | 𐄂\n \n \n \\*: shapeless provides only the way to abstract over the structure of data, but several libraries build upon shapeless to provide the feature listed in the table.\n \n[Skeumorph](https://github.com/higherkindness/skeuomorph) is also a possible competitor, however it is focused on providing translation between different formats (Avro, Protobuf and Mu). This is achieved by using a central Schema Representation which can losslessly translate to each of the previously mentioned formats.\n \n## Background\n\nSchemaZ shares ideas with @nuttycom's [xenomorph](https://github.com/nuttycom/xenomorph) library. The talk below presents its design.\n\n\u003ca href=\"http://www.youtube.com/watch?feature=player_embedded\u0026v=oRLkb6mqvVM\" target=\"_blank\"\u003e\u003cimg src=\"http://img.youtube.com/vi/oRLkb6mqvVM/0.jpg\" \nalt=\"Describing Data...with free applicative functors (and more)—Kris Nuttycombe\" width=\"240\" height=\"180\" border=\"10\" /\u003e\u003c/a\u003e\n\nAn Haskell port of the ideas of xenomorph has also been implemented: [haskell-schema](https://github.com/alonsodomin/haskell-schema).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspartanz%2Fschemaz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspartanz%2Fschemaz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspartanz%2Fschemaz/lists"}