py.lib
8:a1729effde3c
Go to Latest
py.lib/awNet/db/sqlite.py
. Убиваем ненужное
1 # -*- coding: utf-8 -*-
3 from sqlite3 import connect as _sqlite_connect
5 from sqlite3 import Warning, Error, DatabaseError, IntegrityError, ProgrammingError
15 def __init__(self, db_file):
17 self._con = _sqlite_connect(db_file)
18 self.q = self._con.execute
19 self.qm = self._con.executemany
20 self.commit = self._con.commit
21 self.rollback = self._con.rollback
24 self.cq("PRAGMA journal=WAL")
26 def __call__(self, *a, **wa):
27 return self.q(*a, **wa)
30 if self._con == None: return
39 def cq(self, *a, **wa):
41 res = self.q(*a, **wa)
44 except Exception as e:
48 def cqm(self, *a, **wa):
50 res = self.qm(*a, **wa)
53 except Exception as e: