admin 管理员组

文章数量: 1086019


2024年4月13日发(作者:易语言自动加入域脚本)

def run(self):

if mmit:

conn = t(me, isolation_level=None, check_same_thread=False)

else:

conn = t(me, check_same_thread=False)

e('PRAGMA journal_mode = %s' % l_mode)

_factory = str

cursor = ()

e('PRAGMA synchronous=OFF')

while True:

req, arg, res = ()

if req == '--close--':

break

elif req == '--commit--':

()

else:

e(req, arg)

if res:

for rec in cursor:

(rec)

('--no more--')

if mmit:

()

()

def execute(self, req, arg=None, res=None):

"""

`execute` calls are non-blocking: just queue up the request and return immediately.

"""

((req, arg or tuple(), res))

def executemany(self, req, items):

for item in items:

e(req, item)

def select(self, req, arg=None):

"""

Unlike sqlite's native select, this select doesn't handle iteration efficiently.

The result of `select` starts filling up with values as soon as the

request is dequeued, and although you can iterate over the result normally

(`for res in (): ...`), the entire result will be in memory.

"""

res = Queue() # results of the select will appear as items in this queue

e(req, arg, res)

while True:

rec = ()

if rec == '--no more--':

break

yield rec

def select_one(self, req, arg=None):

"""Return only the first row of the SELECT, or None if there are no matching rows."""

try:

return iter((req, arg)).next()

except StopIteration:

return None

def commit(self):

e('--commit--')

def close(self):

e('--close--')

#endclass SqliteMultithread


本文标签: 自动 加入 脚本 作者