We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e200a5 commit 5c800b3Copy full SHA for 5c800b3
dbhelper.py
@@ -6,8 +6,12 @@ def __init__(self, dbname="todo.sqlite"):
6
self.conn = sqlite3.connect(dbname)
7
8
def setup(self):
9
- stmt = "CREATE TABLE IF NOT EXISTS items (description text, owner text)"
10
- self.conn.execute(stmt)
+ tblstmt = "CREATE TABLE IF NOT EXISTS items (description text, owner text)"
+ itemidx = "CREATE INDEX IF NOT EXISTS itemIndex ON items (description ASC)"
11
+ ownidx = "CREATE INDEX IF NOT EXISTS ownIndex ON items (owner ASC)"
12
+ self.conn.execute(tblstmt)
13
+ self.conn.execute(itemidx)
14
+ self.conn.execute(ownidx)
15
self.conn.commit()
16
17
def add_item(self, item_text, owner):
0 commit comments