tea bone
tea bone
DTDrizzle Team
Created by tea bone on 8/28/2023 in #help
Is there a way to create check constraint?
I need to have a check constraint in my schema. I know check function is currently not supported, but is there a way to hack our way into implementing it?
2 replies
DTDrizzle Team
Created by tea bone on 8/7/2023 in #help
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: {};
};
}[]
2 replies
DTDrizzle Team
Created by tea bone on 8/4/2023 in #help
tsc fails to build due to errors
When I run tsc to compile the project to javascript, I am getting the following error:
Found 4 errors in 2 files.

Errors Files
2 node_modules/.pnpm/[email protected][email protected]/node_modules/drizzle-orm/db.d-b9835153.d.ts:593
2 node_modules/.pnpm/[email protected][email protected]/node_modules/drizzle-orm/pg-core/index.d.ts:336
Found 4 errors in 2 files.

Errors Files
2 node_modules/.pnpm/[email protected][email protected]/node_modules/drizzle-orm/db.d-b9835153.d.ts:593
2 node_modules/.pnpm/[email protected][email protected]/node_modules/drizzle-orm/pg-core/index.d.ts:336
Weird thing is, it actually compiles successfully, and I can start the app. Can I just ignore the error?
3 replies