Skip to content

Conversation

@rmobmina
Copy link

@rmobmina rmobmina commented Dec 4, 2025

api/models/efp_schemas.py
Defines every “simple” eFP schema once in Python: columns, types, defaults, indexes, seed rows, metadata.
This is the single source of truth.
Add or edit schema entries here to support new datasets. No SQL files required.

api/models/efp_dynamic.py
Generates SQLAlchemy ORM models dynamically at import time from the schema definitions.
Each bind key (e.g., cannabis, dna_damage) becomes a mapped model class.
The app keeps full ORM functionality without writing model files to disk.

api/services/efp_bootstrap.py
Builds real MySQL databases and tables using SQLAlchemy DDL helpers.
Creates databases.
Creates tables.
Optionally inserts seed rows.
All structure is derived from the schema definitions in memory—no static .sql dumps.

scripts/bootstrap_simple_efp_dbs.py
CLI wrapper that bootstraps the simple eFP databases.
Can target all or selected databases:
python scripts/bootstrap_simple_efp_dbs.py --databases cannabis dna_damage embryo
Useful for Docker init scripts or CI setup.

config/init.sh
Runs the bootstrap script before loading any legacy dumps.
This ensures simple eFP databases are created and seeded during container startup.

api/services/efp_data.py
Unified query engine for both dynamic and legacy datasets.
Handles:
- bind key resolution
- MySQL vs SQLite fallback
- AGI → probeset mapping
- sample filtering
- schema-specific column differences
All eFP datasets now follow a single query path.

api/resources/efp_proxy.py
Public endpoints exposing the dynamic system:
GET /efp_proxy/expression → uses query_efp_database_dynamic
POST /efp_proxy/bootstrap/simple → triggers the bootstrap process over HTTP

Copy link
Collaborator

@asherpasha asherpasha Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have this file?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this whole vendor directory?

@asherpasha
Copy link
Collaborator

GitHub actions need to pass.

@VinLau
Copy link
Contributor

VinLau commented Dec 18, 2025

@asherpasha Reena updated GH workflow yml files from v2 to v3, small minor changes. Can you see and approve if it's ok?

"""
server_engine = create_engine(server_url)
with server_engine.begin() as conn:
conn.execute(text(f"CREATE DATABASE IF NOT EXISTS `{db_name}` DEFAULT CHARACTER SET {charset}"))

Check failure

Code scanning / CodeQL

SQL query built from user-controlled sources High

This SQL query depends on a
user-provided value
.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants