{"id":16835875,"url":"https://github.com/dennwc/go-fdw","last_synced_at":"2025-03-23T15:31:34.784Z","repository":{"id":57601555,"uuid":"91977684","full_name":"dennwc/go-fdw","owner":"dennwc","description":"Go project template for Foreign Data Wrappers for PostgreSQL","archived":false,"fork":false,"pushed_at":"2019-01-07T17:24:01.000Z","size":18,"stargazers_count":34,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-18T21:54:15.736Z","etag":null,"topics":["fdw","golang","postgresql"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dennwc.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":"2017-05-21T18:08:55.000Z","updated_at":"2024-10-21T12:16:30.000Z","dependencies_parsed_at":"2022-09-26T20:00:38.336Z","dependency_job_id":null,"html_url":"https://github.com/dennwc/go-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/dennwc%2Fgo-fdw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dennwc%2Fgo-fdw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dennwc%2Fgo-fdw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dennwc%2Fgo-fdw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dennwc","download_url":"https://codeload.github.com/dennwc/go-fdw/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245122840,"owners_count":20564387,"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":["fdw","golang","postgresql"],"created_at":"2024-10-13T12:11:35.410Z","updated_at":"2025-03-23T15:31:34.308Z","avatar_url":"https://github.com/dennwc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go FDW for PostgreSQL\n\nAn experimental Go project template for building PostgreSQL Foreign Data Wrappers (FDW).\n\nTested with PostgreSQL v9.6 and Go 1.8.1 on Ubuntu x64.\n\n**Supports:**\n\n* Table scan\n* EXPLAIN\n* Table options\n\nContributions are welcome!\n\n## Getting started\n\nModule entry point is defined in `fdw.go` file (see `SetTable`). This file contains a basic working example, so give it a try.\nLater you will need to rewrite it to suit your needs.\n\n### Build\n\nThe easiest way to build Postgres extension is to run `dennwc/go_fdw` Docker image:\n\n```\ndocker run --rm -v $GOPATH:/gopath -v $PWD/fdw.go:/build/fdw.go -v $PWD/out:/out dennwc/go_fdw\n```\n\nThis command will mount your `./fdw.go` and `GOPATH` to the container, build an extension and copy it to `./out` folder.\n\nIf you don't use Docker, check `Dockerfile` to see what commands are needed to manually setup your build environment.\n\n### Install\n\nTo install an extension just copy it to your Postgres installation. At the end of the build process you'll see following lines:\n\n```\n/usr/bin/install -c -m 755  go_fdw.so '/usr/lib/postgresql/9.6/lib/go_fdw.so'\n/usr/bin/install -c -m 644 .//go_fdw.control '/usr/share/postgresql/9.6/extension/'\n/usr/bin/install -c -m 644 .//go_fdw--1.0.sql  '/usr/share/postgresql/9.6/extension/'\n```\n\nYou can execute the same commands to install an extension locally.\n\n### Testing\n\nExecute following SQL statements to load an extension:\n\n```sql\n-- should match an extension lib name\n-- creates a \"go-fdw\" FDW server record automatically (see go_fdw--1.0.sql)\nCREATE EXTENSION go_fdw;\n\n-- create a foreign table for an extension\nCREATE FOREIGN TABLE public.gotest (\n  id INTEGER NOT NULL,\n  name text NOT NULL\n)\nSERVER \"go-fdw\"\nOPTIONS (foo 'bar');\n```\n\nAnd finally, run the query:\n\n```sql\nSELECT * FROM gotest;\n```\n\n**Note:** After extension is loaded, you'll need to restart Postgres to test any changes to the code.\nDatabase will not reload shared library file automatically.\n\n## Hacking\n\nProject is under development and lacks few features, so feel free to send a PR or file an issue :)\n\nAn official documentation for FDW callbacks can be found [here](https://www.postgresql.org/docs/9.6/static/fdwhandler.html).\nAnd the documentation for Postgres sources is [here](https://doxygen.postgresql.org).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdennwc%2Fgo-fdw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdennwc%2Fgo-fdw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdennwc%2Fgo-fdw/lists"}