commit 3c4d03717686c859e14a3cc60d388f840ea985a5
parent 3b2d8eb488d64ad8e0eaf4218c5e447ca8cf7306
Author: pyratebeard <root@pyratebeard.net>
Date: Wed, 27 Jul 2022 17:31:16 +0100
testing search for series/issue number
Diffstat:
M | longbox | | | 23 | ++++++++++++++++++++--- |
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/longbox b/longbox
@@ -4,7 +4,7 @@
# ░█░░░█░█░█░█░█░█░█▀▄░█░█░▄▀▄░░
# ░▀▀▀░▀▀▀░▀░▀░▀▀▀░▀▀░░▀▀▀░▀░▀░░
#
-# what ░ comic book stash
+# what ░ comic book stash manager
# who ░ pyratebeard <root@pyratebeard.net>
# repo ░ https://git.pyratebeard.net/longbox
#
@@ -13,17 +13,34 @@
# * search?
# * create personal stash database
# * add issues from gcd to stash
-# * easy view stash, web browser?
+# * easy view stash
+# * web browser
+# * ranger style ncurses
from getpass import getpass
from mysql.connector import connect, Error
+search_issue = """
+SELECT gcd_issue.id,gcd_series.name,gcd_issue.number
+FROM gcd_series JOIN gcd_issue
+WHERE gcd_series.name LIKE "%spider-man%"
+AND gcd_series.is_current = 1
+AND gcd_series.last_issue_id = gcd_issue.id
+AND gcd_issue.number = 5
+"""
+
try:
with connect(
host="localhost",
user=input("username: "),
password=getpass("password: "),
+ database="gcd"
) as connection:
- print(connection)
+ with connection.cursor() as cursor:
+ cursor.execute(search_issue)
+ for issue in cursor.fetchall():
+ print(issue)
except Error as e:
print(e)
+
+