B:BD[
3.10306] → [
2.0:439]
data: (await pool.query(` select first(product.id), first(type), first(display_brand), first(producer), first(display_name), first(strain), first(strain_family_effect.name) as strain_family, array_agg((portions, quantity)) from product left outer join variant on (product.id = variant.product) left outer join strain_family_effect on (product.strain_family = strain_family_effect.id) where show = true group by product.id;
`)).rows
data: (await pool.query(` select first(product.id) as id, first(type) as type, first(display_brand) as brand, first(producer) as producer, first(display_name) as name, first(strain) as strain, first(strain_family_effect.name) as strain_family, COALESCE(json_agg(json_build_object('id', variant.id, 'portions', portions, 'quantity', quantity)) filter (where quantity is not null)) as variants, first(concentration_unit) as concentration_unit, first(measurement_unit) as measurement_unit from product left outer join variant on (product.id = variant.product) left outer join strain_family_effect on (product.strain_family = strain_family_effect.id) where show = true group by product.id`)).rows