{"id":20459755,"url":"https://github.com/rosbit/db-proxy","last_synced_at":"2026-05-10T10:14:20.389Z","repository":{"id":157038701,"uuid":"631470573","full_name":"rosbit/db-proxy","owner":"rosbit","description":"a database server to share db connections and limit the parallellism of access to the real database server. ","archived":false,"fork":false,"pushed_at":"2024-06-13T01:30:55.000Z","size":27,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-16T00:24:45.675Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/rosbit.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":"2023-04-23T05:49:26.000Z","updated_at":"2024-06-13T01:30:58.000Z","dependencies_parsed_at":"2024-06-13T06:08:57.602Z","dependency_job_id":"7c11a6ec-3804-4534-9d1c-c5f36036676b","html_url":"https://github.com/rosbit/db-proxy","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/rosbit%2Fdb-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosbit%2Fdb-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosbit%2Fdb-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosbit%2Fdb-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rosbit","download_url":"https://codeload.github.com/rosbit/db-proxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242014722,"owners_count":20057880,"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-15T12:17:11.070Z","updated_at":"2026-05-10T10:14:15.342Z","avatar_url":"https://github.com/rosbit.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Database Proxy\n\n`db-proxy` is database server to share db connections with the same connection parameters,\nand limit the parallellism of access to the real database server. `db-proxy` can be accessed with protocols\nnamed HTTP, net/rpc, or net/rpc over websocket.\n\nThere is a corresponding golang db driver named [db-proxy-driver](https://github.com/rosbit/db-proxy-driver)\nwhich can be used to access `db-proxy`. If you want to make use of the power of `db-proxy`,\nwhat you can do is just replace your driver with `db-proxy-driver`, and paste the real driver name aheader of\nyour origin DSN string with colon as the delimeter. e.g., `mysql:user:password@tcp(ip:port)/db?charset=utf8mb4`.\n\nCurrently, only mysql driver is included in `db-proxy`. Other driver can be included easily\nif necessary.\n\n## Install\n\nrun `go get github.com/rosbit/db-proxy`, an executable `db-proxy` should be found.\n\nThere is a sample configration file named [db-proxy.sample.yaml](db-proxy.sample.yaml), which is\nneeded to run `db-proxy`.\n```yaml\n---\nlisten-host: \"\"\nhttp-listen-port: 7080\njsonl-rpc-listen-prot: 7081\nq-len: 5         # the limit parallellism to access the real db server.\nbase32-chars: \"\" # 32 charactors used as base32 base.\ndsn-params:\n  js-file: name2dsn.js\n  js-func: getDSNByName\ncommon-endpoints:\n  health: /health\n  websocket: /websocket\n```\n\nThere is a also a sample JavaScript file named [name2dsn.js](name2dsn.js), which can provide dsn-name to real dsn mapping dynamically. The sample content of `name2dsn.js`:\n```javascript\nvar name2dsn = {\n\t'test': 'mysql:user:password@tcp(172.16.10.240:3306)/?charset=utf8mb4',\n\t'163': 'mysql:user:password@tcp(192.168.0.163:3306)/?charset=utf8mb4'\n}\n\nfunction getDSNByName(name) {\n\tvar dsn = name2dsn[name];\n\tif (dsn) {\n\t\treturn dsn\n\t}\n\treturn \"\"\n}\n```\n\nWith the helper of `name2dsn.js`, you can specify dsn like `dbproxy:name-of-dsn` if you want to access a real database instance.\n\n## Run\n\ntype `CONF_FILE=./db-proxy.sample.yaml ./db-proxy` to run `db-proxy`\n\n## Status\n\n`db-proxy` is fully tested with `db-proxy-driver`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frosbit%2Fdb-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frosbit%2Fdb-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frosbit%2Fdb-proxy/lists"}