pysolmysql
============
Welcome to pysol
Copyright (C) 2013/2025 Laurent Labatut / Laurent Champagnac
pysolmysql is a set of simple MYSQL client Apis
They are gevent based.
They rely on pymysql.
Usage
===============
```
d_conf = {
"host": "localhost",
"port": 3306,
"database": None,
"user": "root",
"password": "root",
"autocommit": True,
}
ar = MysqlApi.exec_n(d_conf, "select user, host from mysql.user;")
for d_record in ar:
logger.info("user=%s, host=%s", d_record["user"], d_record["host"])
```
Pool
===============
Now backed by a basic pool implementation, which support underlying backend clusters (mariadb galera for instance)
This basic pool implementation is forked and adapted from :
- https://github.com/laurentL/django-mysql-geventpool-27
- https://github.com/shunsukeaihara/django-mysql-geventpool
Pool max size
===============
Pool max size (default 10) can be specified using
```
d_conf = {
"pool_max_size": 10,
...
}
```
Possible backward compatibility issue:
- If the pool is maxed, an exception will be raised
Multiple hosts
===============
Multiple hosts can be addressed in an active/active manner.
Several hosts can be specified using :
- "hosts" list (preferred)
```
d_conf = {
"hosts": ["localhost", "127.0.0.1"],
...
}
```
- "host" comma separated list
```
d_conf = {
"host": "localhost,127.0.0.1",
...
}
```
- "host" single entry (backward compatible mode)
```
d_conf = {
"host": "localhost",
...
}
```
Raw data
{
"_id": null,
"home_page": "https://github.com/champax/pysolmysql",
"name": "pysolmysql",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": "Laurent Labatut <laurent@labatut.net>, Laurent Champagnac <champagnac.laurent@gmail.com>",
"keywords": "python, gevent",
"author": "Laurent Champagnac",
"author_email": "Laurent Labatut <laurent@labatut.net>, Laurent Champagnac <champagnac.laurent@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/ba/20/19ae70a1e0a87c210710b7bd6ccbdc947e28d55fbf8a992659e3e500ec1d/pysolmysql-3.13.3.tar.gz",
"platform": null,
"description": "pysolmysql\n============\n\nWelcome to pysol\n\nCopyright (C) 2013/2025 Laurent Labatut / Laurent Champagnac\n\npysolmysql is a set of simple MYSQL client Apis\n\nThey are gevent based.\nThey rely on pymysql.\n\nUsage\n===============\n\n```\nd_conf = {\n \"host\": \"localhost\",\n \"port\": 3306,\n \"database\": None,\n \"user\": \"root\",\n \"password\": \"root\",\n \"autocommit\": True,\n}\n \nar = MysqlApi.exec_n(d_conf, \"select user, host from mysql.user;\")\n\nfor d_record in ar:\n logger.info(\"user=%s, host=%s\", d_record[\"user\"], d_record[\"host\"])\n```\n\nPool\n===============\n\nNow backed by a basic pool implementation, which support underlying backend clusters (mariadb galera for instance)\n\nThis basic pool implementation is forked and adapted from :\n- https://github.com/laurentL/django-mysql-geventpool-27\n- https://github.com/shunsukeaihara/django-mysql-geventpool\n\nPool max size\n===============\n\nPool max size (default 10) can be specified using\n```\nd_conf = {\n \"pool_max_size\": 10,\n ...\n}\n```\n\nPossible backward compatibility issue:\n- If the pool is maxed, an exception will be raised\n\nMultiple hosts\n===============\n\nMultiple hosts can be addressed in an active/active manner.\n\nSeveral hosts can be specified using :\n- \"hosts\" list (preferred)\n```\nd_conf = {\n \"hosts\": [\"localhost\", \"127.0.0.1\"],\n ...\n}\n```\n\n- \"host\" comma separated list\n```\nd_conf = {\n \"host\": \"localhost,127.0.0.1\",\n ...\n}\n```\n\n- \"host\" single entry (backward compatible mode)\n```\nd_conf = {\n \"host\": \"localhost\",\n ...\n}\n```\n\n",
"bugtrack_url": null,
"license": null,
"summary": "pysolmysql",
"version": "3.13.3",
"project_urls": {
"Homepage": "https://github.com/champax/pysolmysql",
"Repository": "https://github.com/champax/pysolmysql"
},
"split_keywords": [
"python",
" gevent"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "ba2019ae70a1e0a87c210710b7bd6ccbdc947e28d55fbf8a992659e3e500ec1d",
"md5": "cb4389a0d994e3fab50ec2a0fcb401c4",
"sha256": "609e011f8d93748457d72edfbcd219384dcc0a0d9e5852001ac9ce259a004e75"
},
"downloads": -1,
"filename": "pysolmysql-3.13.3.tar.gz",
"has_sig": false,
"md5_digest": "cb4389a0d994e3fab50ec2a0fcb401c4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 20722,
"upload_time": "2025-09-10T09:36:38",
"upload_time_iso_8601": "2025-09-10T09:36:38.520392Z",
"url": "https://files.pythonhosted.org/packages/ba/20/19ae70a1e0a87c210710b7bd6ccbdc947e28d55fbf8a992659e3e500ec1d/pysolmysql-3.13.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-10 09:36:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "champax",
"github_project": "pysolmysql",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "greenlet",
"specs": []
},
{
"name": "gevent",
"specs": []
},
{
"name": "pysolbase",
"specs": [
[
">=",
"3.13.0"
]
]
},
{
"name": "pysolmeters",
"specs": [
[
">=",
"3.13.0"
]
]
},
{
"name": "pymysql",
"specs": []
},
{
"name": "ujson",
"specs": []
}
],
"tox": true,
"lcname": "pysolmysql"
}