mirror of
https://github.com/r4sas/Niflheim-api
synced 2025-09-06 03:01:52 +00:00
Update vserv.py
This commit is contained in:
parent
7270820bb9
commit
81a630179a
8
vserv.py
8
vserv.py
@ -41,8 +41,8 @@ def isdatabase(db_path):
|
|||||||
try:
|
try:
|
||||||
conn = sqlite3.connect(db_path + 'yggindex.db')
|
conn = sqlite3.connect(db_path + 'yggindex.db')
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
c.execute('''create table yggindex(ipv6 varchar(45) UNIQUE, coords varchar(50),\
|
c.execute('create table yggindex(ipv6 varchar(45) UNIQUE, coords varchar(50),\
|
||||||
time timestamp default (strftime('%s', 'now')))''')
|
utimestamp int(40))')
|
||||||
conn.commit()
|
conn.commit()
|
||||||
except Error as e:
|
except Error as e:
|
||||||
print(e)
|
print(e)
|
||||||
@ -56,8 +56,8 @@ def insert_new_entry(db_path, ipv6, coords):
|
|||||||
try:
|
try:
|
||||||
conn = sqlite3.connect(db_path + "yggindex.db")
|
conn = sqlite3.connect(db_path + "yggindex.db")
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
c.execute('''INSERT OR REPLACE INTO yggindex(ipv6, coords) VALUES(?, ?)''',\
|
c.execute('''INSERT OR REPLACE INTO yggindex(ipv6, coords, utimestamp) VALUES(?, ?, ?)''',\
|
||||||
(ipv6, coords))
|
(ipv6, coords, utimestamp))
|
||||||
conn.commit()
|
conn.commit()
|
||||||
conn.close()
|
conn.close()
|
||||||
except Error as e:
|
except Error as e:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user