{"id":43448515,"url":"https://github.com/aleasoluciones/infmysql","last_synced_at":"2026-02-03T01:15:51.058Z","repository":{"id":137627348,"uuid":"350622222","full_name":"aleasoluciones/infmysql","owner":"aleasoluciones","description":"🗄️ MySQL infrastructure (wrapper for mysqlclient)","archived":false,"fork":false,"pushed_at":"2025-11-25T06:19:50.000Z","size":50,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-11-28T14:28:07.189Z","etag":null,"topics":["mysql","mysqlclient","mysqldb","python3","wrapper"],"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/aleasoluciones.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-03-23T07:43:34.000Z","updated_at":"2025-11-25T06:19:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"e4251a70-c99a-49be-b0e6-18e5c6764aeb","html_url":"https://github.com/aleasoluciones/infmysql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aleasoluciones/infmysql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleasoluciones%2Finfmysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleasoluciones%2Finfmysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleasoluciones%2Finfmysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleasoluciones%2Finfmysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aleasoluciones","download_url":"https://codeload.github.com/aleasoluciones/infmysql/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleasoluciones%2Finfmysql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29025804,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T00:53:18.321Z","status":"ssl_error","status_checked_at":"2026-02-03T00:51:45.186Z","response_time":58,"last_error":"SSL_read: 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":["mysql","mysqlclient","mysqldb","python3","wrapper"],"created_at":"2026-02-03T01:15:50.371Z","updated_at":"2026-02-03T01:15:51.037Z","avatar_url":"https://github.com/aleasoluciones.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# infmysql\n\n[![CI](https://github.com/aleasoluciones/infmysql/actions/workflows/ci.yml/badge.svg)](https://github.com/aleasoluciones/infmysql/actions/workflows/ci.yml)\n![Python versions supported](https://img.shields.io/badge/supports%20python-3.9%20|%203.10%20|%203.11-blue.svg)\n\nWrapper for the [mysqlclient](https://mysqlclient.readthedocs.io) library using Python 3.\n\n## Development\n\n### Setup\n\nCreate a virtual environment, install dependencies and load environment variables.\n\n```python\nmkvirtualenv infmysql -p $(which python3)\ndev/setup_venv.sh\nsource dev/env_develop\n```\n\nRun a MySQL Docker container.\n\n```python\ndev/start_local_dependencies.sh\n```\n\n### Running tests, linter \u0026 formatter and configure git hooks\n\nNote that project uses Alea's [pydevlib](https://github.com/aleasoluciones/pydevlib), so take a look at its README to see the available commands.\n\n## infmysql client API\n\nBelow is described the public API that this library provides.\n\nThe client can be initialized using the factory with a database URI and an optional parameter which determines if we want to use a dict cursor (false by default).\n\n\u003e mysql_client = factory.**mysql_client**(*database_uri*, *use_dict_cursor=False*)\n\n### execute()\n\nExecutes a SQL query and returns the result. Passing parameters is possible by using `%s` placeholders in the SQL query, and passing a sequence of values as the second argument of the function.\n\n\u003e mysql_client.**execute**(*query*, *params*)\n\n➡️ Parameters\n\n- **query**: `str`\n- **params** (optional): `tuple\u003cany\u003e`. Defaults to `None`.\n\n⬅️ Returns a tuple of tuples or dictionaries, each containing a row of results.\n\n`tuple\u003ctuple\u003cany\u003e\u003e`\n\n💥 Throws the same exceptions than the mysqlclient library.\n\n#### Usage example\n\n```python\nfrom infmysql import factory\n\nmysql_client = factory.mysql_client('mysql://username:password@host:port/databasename')\n\nsql_query = 'SELECT (name, surname, age) FROM users WHERE age \u003c %s AND active = %s;'\nparams = (30, True, )\n\nresult = mysql_client.execute(sql_query, params)\n\n# (\n#   ('Ann', 'White', 18, ),\n#   ('Axel', 'Schwarz', 21, ),\n#   ('Camille', 'Rouge', '27', ),\n# )\n```\n\n#### Usage example with dict cursor\n\n```python\nfrom infmysql import factory\n\nmysql_client = factory.mysql_client('mysql://username:password@host:port/databasename', use_dict_cursor=True)\n\nsql_query = 'SELECT (name, surname, age) FROM users WHERE age \u003c %s AND active = %s;'\nparams = (30, True, )\n\nresult = mysql_client.execute(sql_query, params)\n\n# (\n#   {'name': 'Ann', 'surname': 'White', 'age': 18},\n#   {'name': 'Axel', 'surname': 'Schwarz', 'age': 21},\n#   {'name': 'Camille', 'surname': 'Rouge', 'age': 27},\n# )\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleasoluciones%2Finfmysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faleasoluciones%2Finfmysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleasoluciones%2Finfmysql/lists"}