{"id":13636954,"url":"https://github.com/SeaQL/seaography","last_synced_at":"2025-04-19T08:33:43.035Z","repository":{"id":59083888,"uuid":"502574157","full_name":"SeaQL/seaography","owner":"SeaQL","description":"🧭 GraphQL framework for SeaORM","archived":false,"fork":false,"pushed_at":"2024-10-24T09:44:25.000Z","size":4996,"stargazers_count":392,"open_issues_count":30,"forks_count":37,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-11-04T18:45:15.495Z","etag":null,"topics":["async-graphql","database","graphql","hacktoberfest","mariadb","mysql","postgres","rust","sql","sqlite"],"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/SeaQL.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"SeaQL"}},"created_at":"2022-06-12T09:40:06.000Z","updated_at":"2024-11-04T09:44:36.000Z","dependencies_parsed_at":"2024-04-02T06:23:16.230Z","dependency_job_id":"70a6e363-cd0d-4ed8-8a95-afa33a37d037","html_url":"https://github.com/SeaQL/seaography","commit_stats":{"total_commits":228,"total_committers":11,"mean_commits":"20.727272727272727","dds":0.5263157894736843,"last_synced_commit":"1d74ad0b58e98761f2841505d7a1687d5b4cfa63"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeaQL%2Fseaography","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeaQL%2Fseaography/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeaQL%2Fseaography/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeaQL%2Fseaography/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SeaQL","download_url":"https://codeload.github.com/SeaQL/seaography/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223795259,"owners_count":17204136,"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":["async-graphql","database","graphql","hacktoberfest","mariadb","mysql","postgres","rust","sql","sqlite"],"created_at":"2024-08-02T00:01:08.293Z","updated_at":"2025-04-19T08:33:43.026Z","avatar_url":"https://github.com/SeaQL.png","language":"Rust","funding_links":["https://github.com/sponsors/SeaQL"],"categories":["Libraries","Rust","sqlite","\u003ca name=\"Rust\"\u003e\u003c/a\u003eRust"],"sub_categories":["Database"],"readme":"\u003cdiv align=\"center\"\u003e\n\n  \u003cimg src=\"https://raw.githubusercontent.com/SeaQL/seaography/main/docs/Seaography.png\" width=\"280\" alt=\"Seaography logo\"/\u003e\n\n  \u003cp\u003e\n    \u003cstrong\u003e🧭 A GraphQL framework and code generator for SeaORM\u003c/strong\u003e\n  \u003c/p\u003e\n\n  [![crate](https://img.shields.io/crates/v/seaography.svg)](https://crates.io/crates/seaography)\n  [![docs](https://docs.rs/seaography/badge.svg)](https://docs.rs/seaography)\n  [![build status](https://github.com/SeaQL/seaography/actions/workflows/tests.yaml/badge.svg)](https://github.com/SeaQL/seaography/actions/workflows/tests.yaml)\n\n\u003c/div\u003e\n\n# Seaography\n\n#### Seaography is a GraphQL framework for building GraphQL resolvers using SeaORM entities. It ships with a CLI tool that can generate ready-to-compile Rust GraphQL servers from existing MySQL, Postgres and SQLite databases.\n\n## Benefits\n\n* Quick and easy to get started\n* Generates readable code\n* Extensible project structure\n* Based on popular async libraries: [async-graphql](https://github.com/async-graphql/async-graphql) and [SeaORM](https://github.com/SeaQL/sea-orm)\n\n## Features\n\n* Relational query (1-to-1, 1-to-N)\n* Pagination for queries and relations (1-N)\n* Filtering with operators (e.g. gt, lt, eq)\n* Order by any column\n* Guard fields, queries or relations\n* Rename fields\n* Mutations (create, update, delete)\n\n(Right now there is no mutation, but it's on our plan!)\n\n## SeaORM Version Compatibility\n\n|                        Seaography                        |                         SeaORM                        |\n|----------------------------------------------------------|-------------------------------------------------------|\n| [1.1](https://crates.io/crates/seaography/1.1.1)         | [1.1](https://crates.io/crates/sea-orm/1.1.2)         |\n| [1.0](https://crates.io/crates/seaography/1.0.0)         | [1.0](https://crates.io/crates/sea-orm/1.0.0)         |\n| [0.12](https://crates.io/crates/seaography/0.12.0)       | [0.12](https://crates.io/crates/sea-orm/0.12.14)      |\n| [0.3](https://crates.io/crates/seaography/0.3.0)         | [0.10](https://crates.io/crates/sea-orm/0.10.7)       |\n\n## Quick start - ready to serve in 3 minutes!\n\n### Install\n\n```sh\ncargo install sea-orm-cli@^1.0.0 # used to generate entities\ncargo install seaography-cli@^1.0.0\n```\n\n### MySQL\n\nSetup the [sakila](https://github.com/SeaQL/seaography/blob/main/examples/mysql/sakila-schema.sql) sample database.\n\n```sh\ncd examples/mysql\nsea-orm-cli generate entity -o src/entities -u mysql://user:pw@127.0.0.1/sakila --seaography\nseaography-cli ./ src/entities mysql://user:pw@127.0.0.1/sakila seaography-mysql-example\ncargo run\n```\n\nGo to http://localhost:8000/ and try out the following queries:\n\n#### Fetch films and their actors\n\n```graphql\n{\n  film(pagination: { page: { limit: 10, page: 0 } }, orderBy: { title: ASC }) {\n    nodes {\n      title\n      description\n      releaseYear\n      actor {\n        nodes {\n          firstName\n          lastName\n        }\n      }\n    }\n  }\n}\n```\n\n#### Fetch store and its employee\n\n```graphql\n{\n  store(filters: { storeId: { eq: 1 } }) {\n    nodes {\n      storeId\n      address {\n        address\n        address2\n      }\n      staff {\n        firstName\n        lastName\n      }\n    }\n  }\n}\n```\n\n### Fetch inactive customers with pagination\n\n```graphql\n{\n  customer(\n    filters: { active: { eq: 0 } }\n    pagination: { page: { page: 2, limit: 3 } }\n  ) {\n    nodes {\n      customerId\n      lastName\n      email\n    }\n    paginationInfo {\n      pages\n      current\n    }\n  }\n}\n```\n\n### The query above using cursor pagination\n\n```graphql\n{\n  customer(\n    filters: { active: { eq: 0 } }\n    pagination: { cursor: { limit: 3, cursor: \"Int[3]:271\" } }\n  ) {\n    nodes {\n      customerId\n      lastName\n      email\n    }\n    pageInfo {\n      hasPreviousPage\n      hasNextPage\n      endCursor\n    }\n  }\n}\n```\n\n### Complex query with filters on relations\n\nFind all inactive customers, include their address, and their payments with amount greater than 7 ordered by amount the second result\n\n```graphql\n{\n  customer(\n    filters: { active: { eq: 0 } }\n    pagination: { cursor: { limit: 3, cursor: \"Int[3]:271\" } }\n  ) {\n    nodes {\n      customerId\n      lastName\n      email\n      address {\n        address\n      }\n      payment(\n        filters: { amount: { gt: \"7\" } }\n        orderBy: { amount: ASC }\n        pagination: { page: { limit: 1, page: 1 } }\n      ) {\n        nodes {\n          paymentId\n          amount\n        }\n        paginationInfo {\n          pages\n          current\n        }\n        pageInfo {\n          hasPreviousPage\n          hasNextPage\n        }\n      }\n    }\n    pageInfo {\n      hasPreviousPage\n      hasNextPage\n      endCursor\n    }\n  }\n}\n```\n\n### Filter using enumeration\n```graphql\n{\n  film(\n    filters: { rating: { eq: NC17 } }\n    pagination: { page: { page: 1, limit: 5 } }\n  ) {\n    nodes {\n      filmId\n      rating\n    }\n  }\n}\n```\n\n### Postgres\n\nSetup the [sakila](https://github.com/SeaQL/seaography/blob/main/examples/postgres/sakila-schema.sql) sample database.\n\n```sh\ncd examples/postgres\nsea-orm-cli generate entity -o src/entities -u postgres://user:pw@localhost/sakila --seaography\nseaography-cli ./ src/entities postgres://user:pw@localhost/sakila seaography-postgres-example\ncargo run\n```\n\n### SQLite\n\n```sh\ncd examples/sqlite\nsea-orm-cli generate entity -o src/entities -u sqlite://sakila.db --seaography\nseaography-cli ./ src/entities sqlite://sakila.db seaography-sqlite-example\ncargo run\n```\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n\nSeaography is a community driven project. We welcome you to participate, contribute and together build for Rust's future.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSeaQL%2Fseaography","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSeaQL%2Fseaography","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSeaQL%2Fseaography/lists"}