{"id":18004741,"url":"https://github.com/goodmanwen/cx_oracle_async","last_synced_at":"2025-03-26T10:31:42.045Z","repository":{"id":42045779,"uuid":"324628588","full_name":"GoodManWEN/cx_Oracle_async","owner":"GoodManWEN","description":"A very simple asynchronous wrapper that allows you to get access to the Oracle database in asyncio programs.","archived":false,"fork":false,"pushed_at":"2023-07-06T12:12:08.000Z","size":122,"stargazers_count":39,"open_issues_count":11,"forks_count":16,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-09-16T14:19:06.752Z","etag":null,"topics":["asyncio-programs","cx-oracle","oracle-client","oracle-database"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GoodManWEN.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":"2020-12-26T20:17:51.000Z","updated_at":"2024-09-04T08:44:44.000Z","dependencies_parsed_at":"2023-02-10T04:25:21.924Z","dependency_job_id":null,"html_url":"https://github.com/GoodManWEN/cx_Oracle_async","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodManWEN%2Fcx_Oracle_async","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodManWEN%2Fcx_Oracle_async/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodManWEN%2Fcx_Oracle_async/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodManWEN%2Fcx_Oracle_async/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GoodManWEN","download_url":"https://codeload.github.com/GoodManWEN/cx_Oracle_async/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222138061,"owners_count":16937415,"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":["asyncio-programs","cx-oracle","oracle-client","oracle-database"],"created_at":"2024-10-30T00:15:48.918Z","updated_at":"2024-10-30T00:15:49.544Z","avatar_url":"https://github.com/GoodManWEN.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cx_Oracle_async\n[![fury](https://img.shields.io/pypi/v/cx-Oracle-async.svg)](https://pypi.org/project/cx-Oracle-async/)\n[![licence](https://img.shields.io/github/license/GoodManWEN/cx_Oracle_async)](https://github.com/GoodManWEN/cx_Oracle_async/blob/master/LICENSE)\n[![pyversions](https://img.shields.io/pypi/pyversions/cx-Oracle-async.svg)](https://pypi.org/project/cx-Oracle-async/)\n[![Publish](https://github.com/GoodManWEN/cx_Oracle_async/workflows/Publish/badge.svg)](https://github.com/GoodManWEN/cx_Oracle_async/actions?query=workflow:Publish)\n[![Build](https://github.com/GoodManWEN/cx_Oracle_async/workflows/Build/badge.svg)](https://github.com/GoodManWEN/cx_Oracle_async/actions?query=workflow:Build)\n[![Docs](https://readthedocs.org/projects/cx-oracle-async/badge/?version=latest)](https://readthedocs.org/projects/cx-oracle-async/)\n[![Visitors](https://visitor-badge.glitch.me/badge?page_id=goodmanwen.cx_Oracle_async\u0026style=flat-square\u0026color=0088cc)](https://github.com/GoodManWEN/cx_Oracle_async/)\n\nA very simple asynchronous wrapper that allows you to get access to the Oracle database in asyncio programs.\n\nEasy to use , buy may not the best practice for efficiency concern.\n\n## About development release\nIn parallel with the main branch, we have worked on a development version based on [SQLAlchemy](https://github.com/sqlalchemy/sqlalchemy)'s thread pool management facilities, please refer to [Development notes](https://github.com/GoodManWEN/cx_Oracle_async/blob/dev/misc/Development_notes.md) for details. \n\n## Requirements\n- [cx_Oracle \u003e= 8.1.0](https://github.com/oracle/python-cx_Oracle) (Take into consideration that author of cx_Oracle said he's trying to implement asyncio support , APIs maybe change in future version. Switch to 8.1.0 if there's something wrong makes it not gonna work.)\n- [ThreadPoolExecutorPlus \u003e= 0.2.0](https://github.com/GoodManWEN/ThreadPoolExecutorPlus)\n\n## Install\n\n    pip install cx_Oracle_async\n\n## Feature\n- Nearly all the same as aiomysql in asynchronous operational approach , with limited cx_Oracle feature support.\n- No automaticly date format transition built-in.\n- AQ feature added , check [docs here](https://cx_oracle_async.readthedocs.io/en/latest/user_guide/advancedfeatures.html#oracle-advanced-queuing-aq) for further information.\n- You can modify some of the connection properties simply like you're using cx_Oracle. \n- You can do basic insert / select / delete etc.\n- If you're connecting to database which is on a different machine from python process , you need to install oracle client module in order to use this library. Check [cx-Oracle's installation guide](https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html) for further information.\n\n## Documentation\n\n[https://cx_oracle_async.readthedocs.io](https://cx_oracle_async.readthedocs.io)\n\n## Performance\nquery type | asynchronous multithreading | synchronous multithreading | synchronous single thread\n-|-|-|-\nfast single line query | 6259.80 q/s | 28906.93 q/s | 14805.61 q/s\nsingle line insertion | 1341.88 q/s | 1898 q/s | 1685.17 q/s\n\n*/\\* Test platform: \\*/*\u003cbr\u003e\n*AMD Ryzen 3700x*\u003cbr\u003e\n*Windows 10 LTSC*\u003cbr\u003e\n*Oracle 19c*\u003cbr\u003e\n*You can find performance test codes [here](https://github.com/GoodManWEN/cx_Oracle_async/blob/main/misc).*\n\n## Examples\nBefore running examples , make sure you've already installed a [Oracle Client](https://cx-oracle-async.readthedocs.io/en/latest/user_guide/quickstart.html#install-oracle-client) on your machine.\n```Python\n# basic_usages.py\nimport asyncio\nimport cx_Oracle_async\n\nasync def main():\n    oracle_pool = await cx_Oracle_async.create_pool(\n        host='localhost', \n        port='1521',\n        user='user', \n        password='password',\n        service_name='orcl', \n        min = 2,\n        max = 4,\n    )\n\n    async with oracle_pool.acquire() as connection:\n        async with connection.cursor() as cursor:\n            await cursor.execute(\"SELECT * FROM V$SESSION\")\n            print(await cursor.fetchall())\n\n    await oracle_pool.close()\n\nif __name__ == '__main__':\n    asyncio.run(main())\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoodmanwen%2Fcx_oracle_async","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoodmanwen%2Fcx_oracle_async","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoodmanwen%2Fcx_oracle_async/lists"}