{"id":21966026,"url":"https://github.com/wgliang/pgproxy","last_synced_at":"2025-09-23T11:21:19.174Z","repository":{"id":57497501,"uuid":"81297363","full_name":"wgliang/pgproxy","owner":"wgliang","description":"PostgreSQL proxy server.","archived":false,"fork":false,"pushed_at":"2017-05-02T03:32:12.000Z","size":5931,"stargazers_count":220,"open_issues_count":6,"forks_count":36,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-08-21T13:45:47.989Z","etag":null,"topics":["database","postgresql","proxy-server"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/wgliang.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-02-08T06:48:20.000Z","updated_at":"2025-06-18T12:25:12.000Z","dependencies_parsed_at":"2022-09-03T23:52:31.205Z","dependency_job_id":null,"html_url":"https://github.com/wgliang/pgproxy","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/wgliang/pgproxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wgliang%2Fpgproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wgliang%2Fpgproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wgliang%2Fpgproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wgliang%2Fpgproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wgliang","download_url":"https://codeload.github.com/wgliang/pgproxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wgliang%2Fpgproxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276563398,"owners_count":25664605,"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","status":"online","status_checked_at":"2025-09-23T02:00:09.130Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","postgresql","proxy-server"],"created_at":"2024-11-29T12:56:40.205Z","updated_at":"2025-09-23T11:21:19.109Z","avatar_url":"https://github.com/wgliang.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![pgproxy](./pgproxy.png)\n\n# pgproxy\n[![Build Status](https://travis-ci.org/wgliang/pgproxy.svg?branch=master)](https://travis-ci.org/wgliang/pgproxy)\n[![codecov](https://codecov.io/gh/wgliang/pgproxy/branch/master/graph/badge.svg)](https://codecov.io/gh/wgliang/pgproxy)\n[![GoDoc](https://godoc.org/github.com/wgliang/pgproxy?status.svg)](https://godoc.org/github.com/wgliang/pgproxy)\n[![Code Health](https://landscape.io/github/wgliang/pgproxy/master/landscape.svg?style=flat)](https://landscape.io/github/wgliang/pgproxy/master)\n[![Code Issues](https://www.quantifiedcode.com/api/v1/project/98b2cb0efd774c5fa8f9299c4f96a8c5/badge.svg)](https://www.quantifiedcode.com/app/project/98b2cb0efd774c5fa8f9299c4f96a8c5)\n[![Go Report Card](https://goreportcard.com/badge/github.com/wgliang/pgproxy)](https://goreportcard.com/report/github.com/wgliang/pgproxy)\n[![License](https://img.shields.io/badge/LICENSE-Apache2.0-ff69b4.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)\n\npgproxy is a postgresql proxy server, through a pipe redirect connection, which allows you to filter the requested sql statement. In the future it will support multi-database backup, adapt to distributed databases and other schemes except the  analyze sql statement.\n\nYou can do:\n\n* database read and write separation\n* database services disaster recovery\n* proxy database\n* rewrite sql statement\n* filter dangerous sql\n* monitor database operations\n* sql requests current limit and merge\n\n## Installation\n\n```\n$ go get -u github.com/wgliang/pgproxy\n```\n\n## Using\n\n### As a separate application\n\nStart or shut down the proxy server.\n```\n$ pgproxy start/stop\n```\n\nUse pgproxy on the command line\n```\n$ pgproxy cli\n```\n\nPs: You can use it as you would with a native command line.\n\n### Be called as a package\n\n[package_example](https://github.com/wgliang/pgproxy/blob/master/examples/package_example.go)\n\n```\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"os/signal\"\n\t\"syscall\"\n\n\t\"github.com/wgliang/pgproxy/cli\"\n)\n\nfunc main() {\n\t// call proxy\n\tcli.Main(\"../pgproxy.conf\", []string{\"pgproxy\", \"start\"})\n\t\n\t// 捕获ctrl-c,平滑退出\n\tchExit := make(chan os.Signal, 1)\n\tsignal.Notify(chExit, syscall.SIGINT, syscall.SIGTERM, syscall.SIGKILL)\n\tselect {\n\tcase \u003c-chExit:\n\t\tfmt.Println(\"Example EXITING...Bye.\")\n\t}\n}\n\n```\n\n## Support\n\nselect/delete/update statement and support any case.\n\nOn the support of the sql standard：\n\nThe parser is forked from vitess's [sqlparser](https://github.com/youtube/vitess/tree/master/go/vt/sqlparser) of youtube.\n\nIn pgproxy, database tables are like MySQL(5.6,5.7) relational tables, and you can use relational modeling schemes (normalization) to structure your schema. It supports almost all MySQL(5.6,5.7) scalar data types. It also provides full SQL support within a shard, including JOIN statements. Some postgresql operations are not supported,detail see [support type and keywords](https://github.com/wgliang/pgproxy/blob/master/parser/token.go#L37).\n\n\n## Credits\n\nPackage parser is based on [sqlparser](https://github.com/xwb1989/sqlparser)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwgliang%2Fpgproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwgliang%2Fpgproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwgliang%2Fpgproxy/lists"}