fix(site-finder): SQLAlchemy syntax error :weights::jsonb → CAST(:weights AS jsonb) #152

Merged
lekss361 merged 1 commit from fix/weight-profiles-sqlalchemy-cast-syntax into main 2026-05-15 05:12:18 +00:00

View file

@ -99,7 +99,7 @@ _INSERT = """
INSERT INTO user_weight_profiles
(user_id, profile_name, weights, is_default, description)
VALUES
(:user_id, :profile_name, :weights::jsonb, :is_default, :description)
(:user_id, :profile_name, CAST(:weights AS jsonb), :is_default, :description)
RETURNING id, created_at, updated_at
"""
@ -270,7 +270,7 @@ def update_profile(
params["profile_name"] = payload.profile_name
if payload.weights is not None:
sets.append("weights = :weights::jsonb")
sets.append("weights = CAST(:weights AS jsonb)")
params["weights"] = json.dumps(payload.weights, ensure_ascii=False)
if payload.description is not None: