mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
add .cursor()
This commit is contained in:
parent
d0fb87d432
commit
104b77b53f
1 changed files with 4 additions and 1 deletions
|
@ -5,7 +5,7 @@
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from sqlite3 import dbapi2 as sqlite
|
from sqlite3 import dbapi2 as sqlite, Cursor
|
||||||
|
|
||||||
DBError = sqlite.Error
|
DBError = sqlite.Error
|
||||||
|
|
||||||
|
@ -108,3 +108,6 @@ class DB:
|
||||||
# strip out invalid utf-8 when reading from db
|
# strip out invalid utf-8 when reading from db
|
||||||
def _textFactory(self, data):
|
def _textFactory(self, data):
|
||||||
return str(data, errors="ignore")
|
return str(data, errors="ignore")
|
||||||
|
|
||||||
|
def cursor(self, factory=Cursor):
|
||||||
|
return self._db.cursor(factory)
|
||||||
|
|
Loading…
Reference in a new issue