This commit is contained in:
yumoqing 2025-10-20 10:17:51 +08:00
parent b56afa920e
commit 92f2857ce6
2 changed files with 3 additions and 4 deletions

View File

@ -28,7 +28,7 @@ SQLOR is a database api for python3, it is base on the python's DBAPI2
```
import asyncio
from sqlor.dbpools import DBPools
from sqlor.dbpools import DBPools, sqlorContext
dbs={
"aiocfae":{
@ -72,8 +72,7 @@ loop = asyncio.get_event_loop()
pool = DBPools(dbs,loop=loop)
async def testfunc():
db = DBPools()
async with db.sqlorContext('stock') as sor:
async with sqlorContext('stock') as sor:
# start a transaction
# if exception happended, all change to database will rollback
# else will commit

View File

@ -80,7 +80,7 @@ class SQLor(object):
self.sqlts = sqlts
self.sqlvp = sqlvp
self.sqlvs = sqlvs
self.dbdesc = dbdesc
self.dbdesc = dbdesc.copy()
self.unpassword()
self.dbname = None
self.writer = None