aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-11-22 10:02:40 -0600
committerFrederick Muriuki Muriithi2024-11-22 10:17:19 -0600
commit463194da3cfc077513e98948dd31cfd60d2eb0e0 (patch)
tree90716f2a8e7b64772871df24e28f6c5a788deca4 /scripts
parentcab78050064424d31534c3bba9c68080108dacd6 (diff)
downloadgn-auth-463194da3cfc077513e98948dd31cfd60d2eb0e0.tar.gz
Use code in gn_libs for MySQL/MariaDB connection.
Update the application to use the gn_libs code for connecting to the database, rather than using a local module.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/assign_data_to_default_admin.py3
-rw-r--r--scripts/batch_assign_data_to_default_admin.py2
-rw-r--r--scripts/link_inbredsets.py3
-rw-r--r--scripts/search_phenotypes.py2
4 files changed, 4 insertions, 6 deletions
diff --git a/scripts/assign_data_to_default_admin.py b/scripts/assign_data_to_default_admin.py
index d10b687..69fc50c 100644
--- a/scripts/assign_data_to_default_admin.py
+++ b/scripts/assign_data_to_default_admin.py
@@ -11,10 +11,9 @@ from pathlib import Path
from uuid import UUID, uuid4
import click
+from gn_libs import mysqldb as biodb
from MySQLdb.cursors import DictCursor
-from gn_auth.auth.db import mariadb as biodb
-
import gn_auth.auth.db.sqlite3 as authdb
from gn_auth.auth.authentication.users import User
from gn_auth.auth.authorisation.roles.models import (
diff --git a/scripts/batch_assign_data_to_default_admin.py b/scripts/batch_assign_data_to_default_admin.py
index 3df123d..a468019 100644
--- a/scripts/batch_assign_data_to_default_admin.py
+++ b/scripts/batch_assign_data_to_default_admin.py
@@ -7,10 +7,10 @@ import logging
from pathlib import Path
import click
+from gn_libs import mysqldb as biodb
from pymonad.maybe import Just, Maybe, Nothing
from pymonad.tools import monad_from_none_or_value
-from gn_auth.auth.db import mariadb as biodb
from gn_auth.auth.db import sqlite3 as authdb
from gn_auth.auth.authentication.users import User
from gn_auth.auth.authorisation.resources.groups.models import (
diff --git a/scripts/link_inbredsets.py b/scripts/link_inbredsets.py
index 5db7ea8..c78a050 100644
--- a/scripts/link_inbredsets.py
+++ b/scripts/link_inbredsets.py
@@ -6,11 +6,10 @@ import uuid
from pathlib import Path
import click
+from gn_libs import mysqldb as biodb
import gn_auth.auth.db.sqlite3 as authdb
-from gn_auth.auth.db import mariadb as biodb
-
from scripts.assign_data_to_default_admin import (
sys_admins, admin_group, select_sys_admin)
diff --git a/scripts/search_phenotypes.py b/scripts/search_phenotypes.py
index 20d91c9..3bf26dd 100644
--- a/scripts/search_phenotypes.py
+++ b/scripts/search_phenotypes.py
@@ -11,9 +11,9 @@ from datetime import datetime, timedelta
import click
import redis
import requests
+from gn_libs import mysqldb as gn3db
from gn_auth import jobs
-from gn_auth.auth.db import mariadb as gn3db
from gn_auth.auth.db import sqlite3 as authdb
from gn_auth.settings import SQL_URI, AUTH_DB
from gn_auth.auth.authorisation.data.phenotypes import linked_phenotype_data