After upgrading to 0.28.0 from 0.27.2, it is unable to infer the array type

Here is my schema definition:
const badgeTable = pgTable(
"badge",
{
id: text("id").primaryKey(),
issuerAddress: text("issuer_address").notNull(),
title: text("title").notNull(),
skills: text("skills").array().notNull(),
},
);
const badgeTable = pgTable(
"badge",
{
id: text("id").primaryKey(),
issuerAddress: text("issuer_address").notNull(),
title: text("title").notNull(),
skills: text("skills").array().notNull(),
},
);
And when I run the following query:
const rows = await this.db.select().from(badgeTable).where(eq(badgeTable.id, id));
const rows = await this.db.select().from(badgeTable).where(eq(badgeTable.id, id));
The inferred type of rows is this:
const rows: {
id: string;
issuerAddress: string;
title: string;
skills: {
name: never;
enumValues: {
0: never;
concat: {};
indexOf: {};
lastIndexOf: {};
slice: {};
length: never;
includes: {};
at: {};
toString: {};
toLocaleString: {};
... 23 more ...;
flat: {};
};
... 14 more ...;
getSQL: {};
};
}[]
const rows: {
id: string;
issuerAddress: string;
title: string;
skills: {
name: never;
enumValues: {
0: never;
concat: {};
indexOf: {};
lastIndexOf: {};
slice: {};
length: never;
includes: {};
at: {};
toString: {};
toLocaleString: {};
... 23 more ...;
flat: {};
};
... 14 more ...;
getSQL: {};
};
}[]
1 Reply
tea bone
tea boneOP2y ago
And the weird thing is, when I use InferModel as following:
type Badge = InferModel<typeof badgeTable, "select">;
type Badge = InferModel<typeof badgeTable, "select">;
The inferred Badge type actually has skills: string[]
Want results from more Discord servers?
Add your server