aboutsummaryrefslogtreecommitdiff
path: root/uploader/db
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-08-29 15:21:27 -0500
committerFrederick Muriuki Muriithi2024-08-30 15:06:24 -0500
commite49b4367f1dab1c3acb3cd5d71ba09359c5ab4ee (patch)
tree63035669dd9a82bccee60b572a565d028cf3ef38 /uploader/db
parentf95037b93329d5a4953b81ba1b58e4028a6274e8 (diff)
downloadgn-uploader-e49b4367f1dab1c3acb3cd5d71ba09359c5ab4ee.tar.gz
Initialise package for dealing with Species.
Diffstat (limited to 'uploader/db')
-rw-r--r--uploader/db/species.py22
1 files changed, 0 insertions, 22 deletions
diff --git a/uploader/db/species.py b/uploader/db/species.py
deleted file mode 100644
index 653e59b..0000000
--- a/uploader/db/species.py
+++ /dev/null
@@ -1,22 +0,0 @@
-"""Database functions for species."""
-import MySQLdb as mdb
-from MySQLdb.cursors import DictCursor
-
-def species(conn: mdb.Connection) -> tuple:
- "Retrieve the species from the database."
- with conn.cursor(cursorclass=DictCursor) as cursor:
- cursor.execute(
- "SELECT SpeciesId, SpeciesName, LOWER(Name) AS Name, MenuName, "
- "FullName FROM Species")
- return tuple(cursor.fetchall())
-
- return tuple()
-
-def species_by_id(conn: mdb.Connection, speciesid) -> dict:
- "Retrieve the species from the database by id."
- with conn.cursor(cursorclass=DictCursor) as cursor:
- cursor.execute(
- "SELECT SpeciesId, SpeciesName, LOWER(Name) AS Name, MenuName, "
- "FullName FROM Species WHERE SpeciesId=%s",
- (speciesid,))
- return cursor.fetchone()