{"id":13454244,"url":"https://github.com/solidsnack/GraphpostgresQL","last_synced_at":"2025-03-24T05:33:23.093Z","repository":{"id":28665078,"uuid":"32184664","full_name":"solidsnack/GraphpostgresQL","owner":"solidsnack","description":"GraphQL for Postgres","archived":false,"fork":false,"pushed_at":"2017-03-30T07:27:46.000Z","size":37,"stargazers_count":1090,"open_issues_count":2,"forks_count":28,"subscribers_count":45,"default_branch":"master","last_synced_at":"2025-03-23T22:12:14.852Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PLpgSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/solidsnack.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":null,"security":null,"support":null}},"created_at":"2015-03-13T22:45:41.000Z","updated_at":"2025-03-20T12:51:04.000Z","dependencies_parsed_at":"2022-08-17T22:15:28.439Z","dependency_job_id":null,"html_url":"https://github.com/solidsnack/GraphpostgresQL","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidsnack%2FGraphpostgresQL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidsnack%2FGraphpostgresQL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidsnack%2FGraphpostgresQL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidsnack%2FGraphpostgresQL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/solidsnack","download_url":"https://codeload.github.com/solidsnack/GraphpostgresQL/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245217336,"owners_count":20579290,"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-07-31T08:00:52.167Z","updated_at":"2025-03-24T05:33:20.488Z","avatar_url":"https://github.com/solidsnack.png","language":"PLpgSQL","readme":"# GraphpostgresQL -- a graph interface to relational data\n\nGraphpostgresQL is inspired by Facebook's [`graphql`][graphql]. By using table\nintrospection, GraphpostgresQL is able to follow foreign keys and index into\ncomplex datatypes like `json`, `jsonb` and `hstore`.\n\n[graphql]: https://www.npmjs.com/package/graphql\n\n\n# A Proof of Concept\n\nGraphpostgresQL is alpha quality and has undergone neither extensive\noptimization nor comprehensive testing. To use it for production workloads\nwould needlessly tempt fate.\n\n\n# Install GraphpostgresQL\n\nUsing `psql`, load the `graphql` schema file:\n\n```sql\n\\i graphql.sql\n```\n\nAll definitions are created under the `graphql` schema. GraphpostgresQL\ndoesn't load any extensions or alter the `search_path`. If an older version of\nGraphpostgresQL is loaded, the new installation will overwrite it.\n\n\n# Using GraphpostgresQL\n\nTo generate a query, use `graphql.to_sql(text)`:\n\n```sql\nSELECT graphql.to_sql($$\n  user(\"f3411edc-e1d0-452a-bc19-b42c0d5a0e36\") {\n    full_name,\n    friendship\n  }\n$$);\n```\n\nWhich should result in something like:\n\n```sql\nSELECT to_json(\"sub/2\") AS \"user\"\n  FROM \"user\",\n       LATERAL (\n         SELECT json_agg(\"user\") AS friendship\n           FROM \"user\"\n           JOIN friendship ON ((\"user\".id) = (friendship.second))\n          WHERE (friendship.first)\n              = ('f3411edc-e1d0-452a-bc19-b42c0d5a0e36'::uuid)\n       ) AS \"sub/1\",\n       LATERAL (\n         SELECT \"user\".full_name, \"sub/1\".friendship\n       ) AS \"sub/2\"\n WHERE ((\"user\".id) = ('f3411edc-e1d0-452a-bc19-b42c0d5a0e36'::uuid))\n```\n\nTo run a query, use `graphql.run(text)` instead of `graphql.to_sql(text)`.\n\n\n# Removing GraphpostgresQL\n\nIt's easy to remove GraphpostgresQL:\n\n```sql\nDROP SCHEMA IF EXISTS graphql CASCADE;\n```\n\n\n# Roadmap\n\nIn **GraphpostgresQL64**, we'll introduce expanded selectors (nested selection\nin JSON columns, for example), an interface that accepts keyword parameters,\nand the ability to store and re-execute queries.\n\nIn **GraphpostgresQL3D**, we'll introduce a PL/V8 implementation, with\nextensible parsing, hooks and overall more modular implementation.\n","funding_links":[],"categories":["Libraries","PLpgSQL","Implementations","Community","Uncategorized"],"sub_categories":["SQL Libraries","SQL","Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolidsnack%2FGraphpostgresQL","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolidsnack%2FGraphpostgresQL","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolidsnack%2FGraphpostgresQL/lists"}