TQZJC7K5WOURWCLEFW3OP2SBWE3IGMCXBBLNVDKAPQS7NEHSLRJAC
5Y72WB5QDDV3MJ3FC2TODMYYLZ47CLIRAS6WTNYBFVO5KNOGJIHQC
72DUSPYXB64ECTFQWWD7XSY4YJUNRCFZT22AS4BDRIIUZP33CZGAC
E4HFJ4L4PAGV7R7EXVG2B2CWDGGW7XWU4D37VURZ66HZ3ILHCFUAC
63VXWIHIAKGK7J4VTNRUAG2V32N2QUSWFELB6GD34S54FGRWAPCQC
MM3HQWNEUZVOGQ3WWBTECBY6F47SN4U43I5UNDOAFWO3R7U5XPBAC
WYTMZJFYVKHR4QH7AV5JUNWXT6NAC5NNQNPZCQSDI6LGI7DVXFYAC
Q3A33UTWKXZATZKX3LQ42MUAWFTWDZDMNVMLKWGC3QF6L6HBLUQAC
create or replace function get_store(_store_id integer) returns table(name text, url text, address citext, address2 citext, city citext, region citext, country citext, postal_code citext, longitude decimal, latitude decimal, timezone text, images json, times json) as $$
create or replace function get_store(_store_id integer) returns table(name text, url text, address citext, address2 citext, city citext, region citext, country citext, postal_code citext, longitude decimal, latitude decimal, timezone text, images json, times json, physical boolean) as $$
let stores = (await pool.query('select distinct on(store_id) store_id as id, name, store_image.url from store left outer join store_image using (store_id)')).rows;
let stores = (await pool.query(`select distinct on(store_id) store_id as id, name, type = 'physical', store_image.url from store left outer join store_image using (store_id)`)).rows;