diff --git a/sqlor.egg-info/PKG-INFO b/sqlor.egg-info/PKG-INFO deleted file mode 100644 index de94fac..0000000 --- a/sqlor.egg-info/PKG-INFO +++ /dev/null @@ -1,150 +0,0 @@ -Metadata-Version: 2.1 -Name: sqlor -Version: 0.1.3 -Summary: sqlor -Home-page: https://github.com/yumoqing/sqlor -Author: yumoqing -Author-email: yumoqing@gmail.com -Classifier: Operating System :: OS Independent -Classifier: Programming Language :: Python :: 3 -Classifier: License :: OSI Approved :: MIT License -Description-Content-Type: text/markdown -Requires-Dist: aiomysql -Requires-Dist: PyMySQL -Requires-Dist: aiosqlite -Requires-Dist: asyncio -Requires-Dist: jinja2 - -# SQLOR - -SQLOR is a database api for python3, it is base on the python's DBAPI2 - -## Features - -* Multiple database supported(Oracle, MySql, Postgresql, SQL Server -* Both asynchronous API & synchronous API supported -* Connection pools -* Connection life cycle managements -* Easy using API -* Resources(connection object, cursor object) automatic recycled - - -## requirements - -* python 3.5 or above -* asyncio -* Oracle DBAPI2 driver(cx_Oracle) -* MySQL DBAPI2 driver(mysql-connector) -* Postgresql DBAPI2 driver(psycopg2-binrary) -* Asynchronous MySQL driver(aiomysql) -* Asynchronous Postgresql driver(aiopg) -* Other driver can be easy integreated - -## Using - -``` -import asyncio - -from sqlor.dbpools import DBPools - -dbs={ - "aiocfae":{ - "driver":"aiomysql", - "async_mode":True, - "coding":"utf8", - "dbname":"cfae", - "kwargs":{ - "user":"test", - "db":"cfae", - "password":"test123", - "host":"localhost" - } - }, - "stock":{ - "driver":"aiopg", - "async_mode":True, - "codeing":"utf-8", - "dbname":"stock", - "kwargs":{ - "dbname":"stock", - "user":"test", - "password":"test123", - "host":"127.0.0.1" - } - }, - "cfae":{ - "driver":"mysql.connector", - "coding":"utf8", - "dbname":"cfae", - "kwargs":{ - "user":"test", - "db":"cfae", - "password":"test123", - "host":"localhost" - } - } -} - -loop = asyncio.get_event_loop() -pool = DBPools(dbs,loop=loop) - -async def testfunc(): - @pool.runSQL - def sql(db,ns,callback): - return { - "sql_string":"select * from product", - } - x = await sql('cfae',{},print) - x = await sql('aiocfae',{},print) - -loop.run_until_complete(testfunc()) -``` - -## API - - -### Databases description data(dbdesc) - -sqlor uses a dbdesc data(databases description data) which description -how many databases and what database will using, and them connection parameters to create a dbpools objects - -dbdesc data is a dict data, format of the dbdesc as follow: -``` -{ - "aiocfae":{ # name to identify a database connect - "driver":"aiomysql", # database dbapi2 driver package name - "async_mode":True, # indicte this connection is asynchronous mode - "coding":"utf8", # charset coding - "dbname":"cfae", # database real name - "kwargs":{ # connection parameters - "user":"test", - "db":"cfae", - "password":"test123", - "host":"localhost" - } - }, - "cfae":{ - "driver":"mysql.connector", - "coding":"utf8", - "dbname":"cfae", - "kwargs":{ - "user":"test", - "db":"cfae", - "password":"test123", - "host":"localhost" - } - } -} - -``` -sqlor can using multiple databases and difference databases by using difference database driver - -### sql description data - - -## class - -### DBPools - -### SQLor - diff --git a/sqlor.egg-info/SOURCES.txt b/sqlor.egg-info/SOURCES.txt deleted file mode 100755 index 2b1d487..0000000 --- a/sqlor.egg-info/SOURCES.txt +++ /dev/null @@ -1,30 +0,0 @@ -README.md -setup.py -sqlor/__init__.py -sqlor/aiomysqlor.py -sqlor/aiopostgresqlor.py -sqlor/aiosqliteor.py -sqlor/const.py -sqlor/crud.py -sqlor/dbpools.py -sqlor/ddl_template_mysql.py -sqlor/ddl_template_oracle.py -sqlor/ddl_template_postgresql.py -sqlor/ddl_template_sqlite3.py -sqlor/ddl_template_sqlserver.py -sqlor/filter.py -sqlor/mssqlor.py -sqlor/mysqlor.py -sqlor/oracleor.py -sqlor/postgresqlor.py -sqlor/records.py -sqlor/runsql.py -sqlor/sor.py -sqlor/sqlite3or.py -sqlor/version.py -sqlor.egg-info/PKG-INFO -sqlor.egg-info/SOURCES.txt -sqlor.egg-info/dependency_links.txt -sqlor.egg-info/requires.txt -sqlor.egg-info/top_level.txt -test/test.py \ No newline at end of file diff --git a/sqlor.egg-info/dependency_links.txt b/sqlor.egg-info/dependency_links.txt deleted file mode 100755 index 8b13789..0000000 --- a/sqlor.egg-info/dependency_links.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sqlor.egg-info/requires.txt b/sqlor.egg-info/requires.txt deleted file mode 100644 index 44e24a9..0000000 --- a/sqlor.egg-info/requires.txt +++ /dev/null @@ -1,5 +0,0 @@ -aiomysql -PyMySQL -aiosqlite -asyncio -jinja2 diff --git a/sqlor.egg-info/top_level.txt b/sqlor.egg-info/top_level.txt deleted file mode 100755 index 68b15ea..0000000 --- a/sqlor.egg-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -sqlor