feat: Add get all links function
All checks were successful
Build Docker / Build Main Image (push) Successful in 19s

This commit is contained in:
Nathan Woodburn 2023-11-17 11:12:51 +11:00
parent 19e2064a7a
commit 73ef222feb
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

11
db.py
View File

@ -129,6 +129,17 @@ def get_users_links(domain):
return False return False
return result return result
def get_all_links():
connection = mysql.connector.connect(**dbargs)
cursor = connection.cursor()
cursor.execute("SELECT * FROM links")
result = cursor.fetchall()
cursor.close()
connection.close()
if result == None:
return False
return result
def get_link(url): def get_link(url):
connection = mysql.connector.connect(**dbargs) connection = mysql.connector.connect(**dbargs)
cursor = connection.cursor() cursor = connection.cursor()