Heres my problem. I have the following tables CREATE TABLE inventory( id uuid PRIMARY KEY DEFAULT uuid_generate_v4(), owner text NOT NULL references profile(name) ); CREATE TABLE inventory_item( id uuid PRIMARY KEY DEFAULT uuid_generate_v4(), description text, amount bigint, inventory uuid nOT NULL references table(id) ); Now I would like to query for a single inventory all […]
- Tags "amount":1 } ] } I was thinking of querying id and owner directly and then adding the items as a subquery using ARRAY(). Unfortunat, "amount":32 }, "amount":33 }, "description":"apple", "description":"arrow", "description":"bow", "description":"sword", "items":[ { "id":"2344-123412-34", "owner":"tom", { "id":"234234-1232412-34", { "id":"45454-1123412-34", { "id":"6434-123412-34", amount bigint, amount:'23'}, ARRAY() only works with columns of the same type. So how can I denormalize my table structure into a JSON array for node using a postgres qu, description text, Heres my problem. I have the following tables CREATE TABLE inventory( id uuid PRIMARY KEY DEFAULT uuid_generate_v4(), inventory uuid nOT NULL references table(id) ); Now I would like to query for a single inventory all items in that inventory id and owner, owner text NOT NULL references profile(name) ); CREATE TABLE inventory_item( id uuid PRIMARY KEY DEFAULT uuid_generate_v4(), to send to the client: { "id":"1234123-1234-1234"