Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
|
|
|
|
Decouple the `gn3.db_utils` module from the global `flask.current_app` object,
ensuring that the database uri value is passed in as a required argument to
the `gn3.db_utils.database_connection` function.
|
|
Remove the deprecated function and fix a myriad of bugs that arise from
removing the function.
Issue: https://issues.genenetwork.org/issues/bugfix_coupling_current_app_and_db_utils
|
|
There is need to run external scripts using the same configurations as the
application but without the need to couple the script to the application.
In this case, we provide the needed configuration directly in the CLI, and
modify the existing `gn3.db_utils.database_connection` function to allow it to
work coupled to the app or otherwise.
|
|
The configuration in gn3.settings can (and does) get overwritten by values in
the environment variable `GN3_CONF` and any configurations passed in the call
to the `gn3.app.create_app` function; as such, this commit changes the
configuration used in the code to user the final configuration values that are
in the running application's `flask.current_app.config` object.
|
|
In order for the group leaders (and other resource creators) to be able to
link data to the resources, the data needs to be first linked to the relevant
group.
This commit enables the system admin to link the data in MySQL to the groups.
|
|
* gn3/db/sample_data.py (get_trait_csv_sample_data): Pass __query
directly to cursor.execute. Rename value to _value in for loop to
make mypy pass.
* gn3/db_utils.py (Connection): Add class docstring.
(Connection.cursor): Add docstring.
* mypy.ini: Add an entry for xapian.
|
|
App settings should be accessed from current_app. It should not be hard-coded
to a variable in a module.
* gn3/db_utils.py: Do not import XAPIAN_DB_PATH from gn3.settings.
(xapian_database): Accept path argument.
* gn3/api/search.py: Import current_app from flask.
(search_results): Pass Xapian index path to xapian_database.
|
|
* gn3/db_utils.py (Connection): Disable missing-class-docstring,
missing-function-docstring and too-few-public-methods pylint checks.
|
|
* gn3/settings.py (XAPIAN_DB_PATH): New variable.
* gn3/db_utils.py: Import xapian and XAPIAN_DB_PATH from gn3.settings.
(xapian_database): New function.
|
|
* gn3/db_utils.py: Import contextlib. Import Any, Iterator, Protocol and Tuple
from typing.
(database_connector): Deprecate function.
(Connection): New class.
(database_connection): New function.
|
|
By default, MySQL/Mariadb connects at port 3306, however, the configuration
variable `SQL_URI` could contain a different port. In that case, this commit
allows the system to connect to the non-default port.
|
|
|
|
Use the `with` context manager to open database connections, so as to ensure
that those connections are closed once the call is completed. This hopefully
avoids the 'too many connections' error
|
|
MySQLdb is already ignored in ".mypy.ini", added in 88c33df.
|
|
|
|
- add new api for gn2-gn3 sample r integration
- delete map for sample list to values
- add db util file
- add python msql-client dependency
- add db for fetching lit correlation results
- add unittests for db utils
- add tests for db_utils
- modify api for fetching lit correlation results
- refactor Mock Database Connector and unittests
- add sql url parser
- add SQL URI env variable
- refactor code for db utils
- modify return data for lit correlation
- refactor tissue correlation endpoint
- replace db_instance with conn
|