{"id":18643962,"url":"https://github.com/major/mysql-json-bridge","last_synced_at":"2026-03-08T10:37:42.013Z","repository":{"id":2854442,"uuid":"3858888","full_name":"major/mysql-json-bridge","owner":"major","description":"Get MySQL result sets via JSON","archived":false,"fork":false,"pushed_at":"2022-03-14T13:01:19.000Z","size":16,"stargazers_count":74,"open_issues_count":4,"forks_count":14,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-10T09:13:50.155Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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/major.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}},"created_at":"2012-03-28T19:47:37.000Z","updated_at":"2024-04-19T07:06:39.000Z","dependencies_parsed_at":"2022-08-06T13:00:25.392Z","dependency_job_id":null,"html_url":"https://github.com/major/mysql-json-bridge","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/major%2Fmysql-json-bridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/major%2Fmysql-json-bridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/major%2Fmysql-json-bridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/major%2Fmysql-json-bridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/major","download_url":"https://codeload.github.com/major/mysql-json-bridge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248401933,"owners_count":21097328,"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-07T06:09:08.674Z","updated_at":"2026-03-08T10:37:41.948Z","avatar_url":"https://github.com/major.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"mysql-json-bridge\n=================\nTalk to MySQL using HTTP POST and get result sets via JSON.\n\nKey features\n------------\n\n* Use any scripting/programming language to talk to MySQL\n* Make a single endpoint for multiple environments and database servers\n* Use any authentication mechanism your web server supports for database access\n* Handle queries through HTTP load balancers\n\nInstallation \u0026 Startup\n----------------------\nInstall a few prerequisites:\n\n    pip install flask pyyaml\n    # requests is optional, but you need it to use the quick test file\n    pip install requests \n\nGet the source:\n\n    git clone http://github.com/rackerhacker/mysql-json-bridge\n    cd mysql-json-bridge\n    python app.py\n\nConfiguration\n-------------\nMake a conf.d directory with separate database configuration files:\n\n    # conf.d/database1.yaml\n    ---\n    identifier: 'prod.database1'\n    scheme: 'mysql'\n    username: 'database1'\n    password: 'secret_password'\n    database: 'database1'\n    hostname: 'database1.domain.com'\n    enabled: 'True'\n\n    # conf.d/database2.yaml\n    ---\n    identifier: 'staging.database2'\n    scheme: 'mysql'\n    username: 'database2'\n    password: 'secret_password'\n    database: 'database2'\n    hostname: 'database2.domain.com'\n    enabled: 'True'\n\nUsage\n-----\nLook inside the `examples/query_test.py` file for a quick example.  To issue a query to the bridge, simply make an HTTP POST to the appropriate URL.  Your URL should be something like this:\n\n    http://localhost:5000/query/\u003cdatabase\u003e\n\nYou can also test with curl:\n\n    curl http://localhost:5000/query/production-sales -X POST -d 'sql=SELECT version()'\n\nExample wsgi file for usage with a web server:\n\n    # mysql-json-bridge.wsgi\n    import sys\n    sys.path.insert(0, '/path/to/mysql-json-bridge/')\n    from app import app as application\n\n*IMPORTANT* security considerations\n-----------------------------------\n**The base mysql-json-bridge server doesn't do any query filtering nor does it do any authentication.  You'd need to configure that yourself within your web server.**\n\nAlso, be very careful with the user you configure in your `environments.yml`.  If the user has write access to your database, people could issue UPDATE and DELETE statements through the bridge.\n\nIf you create read-only MySQL users for the bridge to use, **ensure that those users have read access *only* to the databases that you specify.**  Giving global read access to a user allows them to read your `mysql.user` table which contains hashed passwords.  *This could lead to a very bad experience.*\n\nGot improvements?  Found a bug?\n-------------------------------\nIssue a pull request or open an issue in GitHub.  I'm still learning Python and I'm sure there are some better ways to do things than I'm currently doing them.  I appreciate and welcome all feedback you have!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmajor%2Fmysql-json-bridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmajor%2Fmysql-json-bridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmajor%2Fmysql-json-bridge/lists"}