Skip to content Skip to sidebar Skip to footer

Sqlalchmey Func.json_build_object Throwing Error, Could Not Determine Data Type Of Paramater

I am using this sqlalchemy query to to get a result in desired format: query = select( [ Product.name, Product.description, Product.turn

Solution 1:

Not the most elegant way, but this worked for me

func.array_agg(
    func.json_build_object(
        text("'key', table_name.field"),
        text("'key', table_name.field"),
        text("'key', table_name.field")
    )
).label("product_fields"),

Post a Comment for "Sqlalchmey Func.json_build_object Throwing Error, Could Not Determine Data Type Of Paramater"