technova-ml-api / app /db /queries.py
github-actions
deploy: snapshot
5fa8558
raw
history blame contribute delete
494 Bytes
from sqlalchemy import text
# Requetes SQL utilisées par l'API
SQL_INSERT_REQUEST = text("""
INSERT INTO audit.prediction_requests (payload)
VALUES (CAST(:payload AS jsonb))
RETURNING request_id
""")
SQL_INSERT_RESPONSE = text("""
INSERT INTO audit.prediction_responses
(request_id, proba, prediction, threshold)
VALUES (:request_id, :proba, :prediction, :threshold)
""")
SQL_GET_EMPLOYEE_FEATURES = text("""
SELECT *
FROM mart.employee_features
WHERE id_employee = :id_employee
LIMIT 1
""")