{"id":37123048,"url":"https://github.com/neflyte/fdwctl","last_synced_at":"2026-01-14T14:13:01.436Z","repository":{"id":132920240,"uuid":"275250848","full_name":"neflyte/fdwctl","owner":"neflyte","description":"A PostgreSQL Foreign Data Wrapper (FDW) management CLI","archived":false,"fork":false,"pushed_at":"2024-01-05T00:05:11.000Z","size":174,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-21T08:27:14.811Z","etag":null,"topics":["database","postgres","postgresql"],"latest_commit_sha":null,"homepage":"","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/neflyte.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-26T21:27:09.000Z","updated_at":"2024-01-05T00:04:39.000Z","dependencies_parsed_at":"2024-01-05T01:18:28.354Z","dependency_job_id":null,"html_url":"https://github.com/neflyte/fdwctl","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/neflyte/fdwctl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neflyte%2Ffdwctl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neflyte%2Ffdwctl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neflyte%2Ffdwctl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neflyte%2Ffdwctl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neflyte","download_url":"https://codeload.github.com/neflyte/fdwctl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neflyte%2Ffdwctl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28422411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T13:30:50.153Z","status":"ssl_error","status_checked_at":"2026-01-14T13:29:08.907Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["database","postgres","postgresql"],"created_at":"2026-01-14T14:13:00.933Z","updated_at":"2026-01-14T14:13:01.408Z","avatar_url":"https://github.com/neflyte.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![fdwctl](media/fdwctl.svg)\nA PostgreSQL Foreign Data Wrapper (FDW) management CLI\n-\n\n![Golang v1.18+](https://img.shields.io/badge/Golang-v1.18+-blue?style=for-the-badge\u0026logo=go\u0026color=00add8\u0026link=https://go.dev)\n![PostgreSQL v15+](https://img.shields.io/badge/PostgreSQL-v15+-blue?style=for-the-badge\u0026logo=postgresql\u0026color=336791\u0026link=https://postgresql.org)\n\n[Features](#features) | [Installation](#installation) | [Usage](#usage) | [Configuration](#configuration)\n\n### What is it?\n\n`fdwctl` is a command line tool to manage foreign servers, user mappings, and importing remote schemas using the PostgreSQL Foreign Data Wrapper (FDW).\n\n### What does it do?\n\n`fdwctl` allows create, read, update, and delete (CRUD) operations on foreign servers, user mappings, and importing remote schemas with reasonably simple commands. It also can attempt to create local ENUM types that are used by a remote schema before importing that schema.\n\nThe CLI interface is written with the original intention of being used as part of Kubernetes deployments.\n\n### Features\n\n- Supports PostgreSQL `postgres_fdw` wrapper; support for other wrappers is pending\n- Can apply a desired configuration state to a database\n- Single, statically-linked binary; can be compiled on any platform supporting Golang 1.14+\n- Multiple log message formats (Text, JSON; Elasticstack schema support is pending)\n\n### Installation\n\n#### Using Go\n\n```shell script\ngo install https://github.com/neflyte/fdwctl/cmd/fdwctl\n```\n\n### Usage\n\n```\nUsage:\n  fdwctl [command]\n\nAvailable Commands:\n  apply       Apply a desired state\n  create      Create objects\n  drop        Drop (delete) objects\n  edit        Edit objects\n  help        Help about any command\n  list        List objects\n\nFlags:\n      --config string       location of program configuration file\n      --connection string   database connection string\n  -h, --help                help for fdwctl\n      --logformat string    log output format [text, json] (default \"text\")\n      --loglevel string     log message level [trace, debug, info, warn, error, fatal, panic] (default \"trace\")\n      --nologo              suppress program name and version message\n\nUse \"fdwctl [command] --help\" for more information about a command.\n```\n\n#### Examples\n\n##### Create the `postgres_fdw` extension\n\n```shell script\nfdwctl create extension postgres_fdw\n```\n\n##### Create a foreign server\n\n```shell script\nfdwctl create server my-remotedb --serverhost remotedb1 --serverport 5432 --serverdbname remotedb\n```\n\n##### Create a user mapping\n\n```shell script\nfdwctl create usermap --servername my-remotedb --localuser fdw --remoteuser remoteuser --remotepassword 'r3m0TE!'\n```\n\n### Configuration\n\nThe application configuration file is in YAML format and is located at `${HOME}/.config/fdwctl/config.yaml`. An explicit configuration file can be specified by using the `--config` argument. In addition to YAML, JSON format is also supported.\n\n#### Example Configuration File\n\nThe following is an example of the application configuration file in YAML format.\n\n```yaml\nFDWConnection: \"host=localhost port=5432 dbname=fdw user=fdw sslmode=disable\"\nFDWConnectionSecret:\n  value: \"passw0rd\"\nDesiredState:\n  Extensions:\n    - name: postgres_fdw\n  Servers:\n    - name: remotedb\n      host: remotedb1\n      port: 5432\n      db: remotedb\n      UserMap:\n        - localuser: fdw\n          remoteuser: remoteuser\n          remotesecret:\n            value: \"r3m0TE!\"\n            #fromEnv: \"REMOTEDB_CREDENTIAL\"\n            #fromFile: /tmp/credential.txt\n            #fromK8s:\n              #namespace: default\n              #secretName: my-secret-object\n              #secretKey: postgresql-password\n      Schemas:\n        - localschema: remotedb\n          remoteschema: public\n          importenums: true\n          enumconnection: \"postgres://remoteuser@localhost:15432/remotedb?sslmode=disable\"\n          enumsecret:\n            value: \"r3m0TE!\"\n            #fromEnv: \"REMOTEDB_CREDENTIAL\"\n            #fromFile: /tmp/credential.txt\n            #fromK8s:\n              #namespace: default\n              #secretName: my-secret-object\n              #secretKey: postgresql-password\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneflyte%2Ffdwctl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneflyte%2Ffdwctl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneflyte%2Ffdwctl/lists"}