aboutsummaryrefslogtreecommitdiff
path: root/gn3/db
diff options
context:
space:
mode:
Diffstat (limited to 'gn3/db')
-rw-r--r--gn3/db/traits.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/gn3/db/traits.py b/gn3/db/traits.py
index 5ac342f..6c6118a 100644
--- a/gn3/db/traits.py
+++ b/gn3/db/traits.py
@@ -48,3 +48,11 @@ def insert_publication(pubmed_id: int, publication: Optional[Dict],
", ".join(['%s'] * len(publication))))
with conn.cursor() as cursor:
cursor.execute(insert_query, tuple(publication.values()))
+
+
+def insert_phenotype(phenotype: Optional[Dict], conn: Any):
+ insert_query = ("INSERT into Phenotype (%s) Values (%s)" %
+ (", ".join(phenotype.keys()),
+ ", ".join(['%s'] * len(phenotype))))
+ with conn.cursor() as cursor:
+ cursor.execute(insert_query, tuple(phenotype.values()))