Easiest way to add an array of objects?

Hey, I am trying to add an array of objects to my schema with postgres, how can I do this? there seems to be a pgArray but can't find a pgObject 👀


export const products = pgTable("products", {
id: serial("id").primaryKey().unique(),
description: text("description").notNull(),
details: text("details").notNull(),
price: numeric("price").notNull(),
images: array(
pgObject({
title: text("title").notNull(),
tag: text("tag").notNull(),
imageUrl: text("imageUrl").notNull(),
}),
),
});
Was this page helpful?