From 92f2857ce67efe3d4544cf9daab18cb8cc40c150 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 20 Oct 2025 10:17:51 +0800 Subject: [PATCH] bugfix --- README.md | 5 ++--- sqlor/sor.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index dd01447..4cc2a46 100755 --- a/README.md +++ b/README.md @@ -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 diff --git a/sqlor/sor.py b/sqlor/sor.py index 5371c76..8c8743e 100755 --- a/sqlor/sor.py +++ b/sqlor/sor.py @@ -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