forked from nicholasH/roll20Analyzer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DBscratch.py
110 lines (81 loc) · 1.99 KB
/
DBscratch.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
import random
import sqlite3
from datetime import datetime, date, timedelta
import time
import pickle
import DBhandler
def creatDB():
conn = sqlite3.connect('example.db')
c = conn.cursor()
# Create table
c.execute('''CREATE TABLE test
(id INTEGER PRIMARY KEY,name text, test text)''')
conn.commit()
conn.close()
def creatDB2():
conn = sqlite3.connect('example.db')
c = conn.cursor()
# Create table
c.execute('''CREATE TABLE test2
(id INTEGER PRIMARY KEY,name text, test text)''')
conn.commit()
conn.close()
def dis():
conn = sqlite3.connect('example.db')
c = conn.cursor()
c.execute('DROP TABLE IF EXISTS test')
conn.commit()
conn.close()
def printDB():
print("db1")
time.sleep(3)
scratch.update("test")
conn = sqlite3.connect('example.db')
c = conn.cursor()
c.execute("SELECT * FROM test")
conn.commit()
rows = c.fetchall()
for row in rows:
print(row)
conn.close()
def printDB2():
print("db2")
conn = sqlite3.connect('example.db')
c = conn.cursor()
c.execute("SELECT * FROM test2")
conn.commit()
rows = c.fetchall()
for row in rows:
print(row)
conn.close()
def cDB():
DBhandler.createDB("name","https://app.roll20.net/campaigns/chatarchive/1644807")
global x
x = 0
global max
maax = 1000000
def countToMax():
global x,maax
while(x<maax):
x += 1
print(x)
cDB()
"""
#dis()
#creatDB()
#creatDB2()
testname = [('bill'),
('tom'),
('kyle'),
('tom'),]
#conn = sqlite3.connect('example.db')
conn = sqlite3.connect('C:\\Users\\Nick\\Documents\\GitHub\\roll20Analyzer\\data\\dataBase\\test.db')
c = conn.cursor()
tag = "-Kz2334kdVOUgwyno4mX"
c.execute("SELECT Message.* FROM Message JOIN Tags ON Message.MessageID = Tags.MessageID WHERE Time BETWEEN '2017-11-27' AND '2017-12-27'")
conn.commit()
data = c.fetchall()
conn.close()
for d in data:
print(d)
"""