{"id":18440257,"url":"https://github.com/drowzy/pgx_fdw","last_synced_at":"2025-07-28T09:33:40.554Z","repository":{"id":68391886,"uuid":"336606370","full_name":"drowzy/pgx_fdw","owner":"drowzy","description":null,"archived":false,"fork":false,"pushed_at":"2021-04-10T10:14:57.000Z","size":22,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T01:05:37.448Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/drowzy.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}},"created_at":"2021-02-06T18:22:31.000Z","updated_at":"2022-09-23T14:42:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"c0312c0b-f291-4292-9f01-4072b698caad","html_url":"https://github.com/drowzy/pgx_fdw","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/drowzy%2Fpgx_fdw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drowzy%2Fpgx_fdw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drowzy%2Fpgx_fdw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drowzy%2Fpgx_fdw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drowzy","download_url":"https://codeload.github.com/drowzy/pgx_fdw/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247732809,"owners_count":20986929,"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-11-06T06:29:12.915Z","updated_at":"2025-07-28T09:33:40.414Z","avatar_url":"https://github.com/drowzy.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pgx-fdw\n\nExperimental [Foreign Data Wrapper](https://www.postgresql.org/docs/13/fdwhandler.html) support for [pgx](https://github.com/zombodb/pgx).\n\n## Implementing a FDW \n\n1. Impl the trait `pgx_fdw::ForeignData`\n\n```rust\nstruct MyFdw {}\nimpl pgx_fdw::ForeignData for MyFdw {\n    ...\n}\n```\n2. Create handler function\n\n```rust\n/// ```sql\n/// CREATE FUNCTION my_handler() RETURNS fdw_handler LANGUAGE c AS 'MODULE_PATHNAME', 'my_handler_wrapper';\n/// ```\n#[pg_extern]\nfn my_handler() -\u003e pg_sys::Datum {\n    pgx_fdw::FdwState::\u003cMyFdw\u003e::into_datum()\n}\n```\n\n3. Create wrapper + server\n\n```sql\nCREATE FOREIGN DATA WRAPPER my_handler handler my_handler NO VALIDATOR;\nCREATE SERVER my_fdw_srv FOREIGN DATA WRAPPER my_handler OPTIONS (server_option '1', server_option '2');\nCREATE FOREIGN TABLE users (\n    id text,\n    name text,\n    email text\n) SERVER my_fdw_server OPTIONS (\n    table_option '1',\n    table_option2 '2'\n);\n```\n\n## Examples\n* `inmem_table` - Simple in-memory table fdw using `Vec`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrowzy%2Fpgx_fdw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrowzy%2Fpgx_fdw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrowzy%2Fpgx_fdw/lists"}