{"id":23463839,"url":"https://github.com/thalo-rs/esdl","last_synced_at":"2025-07-20T14:05:26.612Z","repository":{"id":40321963,"uuid":"451445389","full_name":"thalo-rs/esdl","owner":"thalo-rs","description":"Event-sourcing Schema Definition Language","archived":false,"fork":false,"pushed_at":"2022-12-12T17:35:57.000Z","size":130,"stargazers_count":45,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-06-03T20:41:13.377Z","etag":null,"topics":["codegen","cqrs-es","esdl","event-sourcing","rust","thalo"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/thalo-rs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-24T11:56:31.000Z","updated_at":"2025-03-19T14:13:37.000Z","dependencies_parsed_at":"2023-01-27T23:01:30.060Z","dependency_job_id":null,"html_url":"https://github.com/thalo-rs/esdl","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/thalo-rs/esdl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thalo-rs%2Fesdl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thalo-rs%2Fesdl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thalo-rs%2Fesdl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thalo-rs%2Fesdl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thalo-rs","download_url":"https://codeload.github.com/thalo-rs/esdl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thalo-rs%2Fesdl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266135685,"owners_count":23881803,"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":["codegen","cqrs-es","esdl","event-sourcing","rust","thalo"],"created_at":"2024-12-24T09:17:05.947Z","updated_at":"2025-07-20T14:05:26.594Z","avatar_url":"https://github.com/thalo-rs.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESDL\n\n**E**vent-sourcing **S**chema **D**efinition **L**anguage\n\n---\n\nSchema definition language for defining aggregates, commands, events \u0026 custom types.\n\nHeavily inspired by GraphQL syntax, you can describe aggregates which can be used for codegen in different languages.\n\n## Install\n\n```toml\nesdl = \"*\"\n```\n\n## Example\n\n```\nversion = \"0.1.0\"\n\naggregate BankAccount {\n  open_account(initial_balance: Float) -\u003e OpenedAccount\n  deposit_funds(amount: Float) -\u003e ReceivedFunds\n  withdraw_funds(amount: Float) -\u003e SentFunds\n  send_funds(amount: Float, user: User) -\u003e (SentFunds? | ReceivedFunds?)\n}\n\nevent OpenedAccount {\n  initial_balance: Float\n}\n\nevent SentFunds {\n  amount: Float\n  user: User?\n}\n\nevent ReceivedFunds {\n  amount: Float\n  user: User?\n}\n\ntype User {\n  id: String\n  name: String?\n}\n```\n\n### Scalar Types\n\n| Scalar   | Rust Type   | TypeScript Type |\n| -------- | ----------- | --------------- |\n| `String` | [`String`]  | [`string`][ts]  |\n| `Int`    | [`i32`]     | [`number`][ts]  |\n| `Long`   | [`i64`]     | [`number`][ts]  |\n| `Float`  | [`f32`]     | [`number`][ts]  |\n| `Double` | [`f64`]     | [`number`][ts]  |\n| `Bool`   | [`bool`]    | [`boolean`][ts] |\n| `Bytes`  | [`Vec\u003cu8\u003e`] | [`string`][ts]  |\n\n[`string`]: https://doc.rust-lang.org/stable/std/string/struct.String.html\n[`i32`]: https://doc.rust-lang.org/stable/std/primitive.i32.html\n[`i64`]: https://doc.rust-lang.org/stable/std/primitive.i64.html\n[`f32`]: https://doc.rust-lang.org/stable/std/primitive.f32.html\n[`f64`]: https://doc.rust-lang.org/stable/std/primitive.f64.html\n[`bool`]: https://doc.rust-lang.org/stable/std/primitive.bool.html\n[`vec\u003cu8\u003e`]: https://doc.rust-lang.org/stable/std/vec/struct.Vec.html\n[ts]: https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#the-primitives-string-number-and-boolean\n\n### Optional \u0026 Required\n\nTypes can be marked as optional by adding the `?` suffix.\n\n| Type     | Syntax | Example   |\n| -------- | ------ | --------- |\n| Required | `T`    | `String`  |\n| Optional | `T?`   | `String?` |\n\n### Repeating Types\n\nTypes can be repeated by wrapping them in `[]`.\n\n| Type   | Syntax | Example    |\n| ------ | ------ | ---------- |\n| Single | `T`    | `String`   |\n| Array  | `[T]`  | `[String]` |\n\nRemember, we can mark types as optional, even in arrays.\n\n| Type                 | Syntax  | Example      |\n| -------------------- | ------- | ------------ |\n| Optional Array       | `[T?]?` | `[String?]?` |\n| Required Array       | `[T?]`  | `[String?]`  |\n| Required Array Items | `[T]?`  | `[String]?`  |\n| Required Array Items | `[T]`   | `[String]`   |\n\n---\n\nIntegrates with [Thalo](https://github.com/thalo-rs/thalo) to generate Rust code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthalo-rs%2Fesdl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthalo-rs%2Fesdl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthalo-rs%2Fesdl/lists"}