We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drizzle-orm
0.28.0
drizzle-kit
0.19.12
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(), }, );
And when I run the following query:
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: {}; }; }[]
And the weird thing is, when I use InferModel as following:
type Badge = InferModel<typeof badgeTable, "select">;
The inferred Badge type actually has skills: string[]
skills: string[]
I expect skills column to be inferred as string[]
string[]
Operating System: Ubuntu 22.04 Turborepo: 1.10.12 Node: 19.8.1 Package Manager: pnpm 8.5.1
The text was updated successfully, but these errors were encountered:
May be related to #983
cc @dankochetov
Sorry, something went wrong.
Fix baseColumn type on Column
c091982
Fixes #983, #992
fc4edb8
Fixes drizzle-team#983, drizzle-team#992
3fc889a
dankochetov
No branches or pull requests
What version of
drizzle-orm
are you using?0.28.0
What version of
drizzle-kit
are you using?0.19.12
Describe the Bug
Here is my schema definition:
And when I run the following query:
The inferred type of rows is this:
And the weird thing is, when I use InferModel as following:
The inferred Badge type actually has
skills: string[]
Expected behavior
I expect skills column to be inferred as
string[]
Environment & setup
Operating System: Ubuntu 22.04
Turborepo: 1.10.12
Node: 19.8.1
Package Manager: pnpm 8.5.1
The text was updated successfully, but these errors were encountered: