pineappaul
pineappaul
Explore posts from servers
DTDrizzle Team
Created by pineappaul on 4/23/2024 in #help
Drizzle pg client throwing `scanner_yyerror` on push
UPDATE: This error will throw when trying to use array() with an enum. Here is the table definition:
export const grantMeta = pgTable("grant_meta", {
id: uuid("id").primaryKey(),
grantType: varchar("grant_type", { length: 256 }).notNull(),
categories: grantCategoryEnum("categories").array().default([]),
subjectType: mediaGrantSubjectTypeEnum("subject_type")
.notNull()
.default("TRACK"),
createdAt: timestamp("created_at").defaultNow().notNull(),
updatedAt: timestamp("updated_at")
.defaultNow()
.notNull()
.$onUpdate(() => sql`NOW()`),
});
export const grantMeta = pgTable("grant_meta", {
id: uuid("id").primaryKey(),
grantType: varchar("grant_type", { length: 256 }).notNull(),
categories: grantCategoryEnum("categories").array().default([]),
subjectType: mediaGrantSubjectTypeEnum("subject_type")
.notNull()
.default("TRACK"),
createdAt: timestamp("created_at").defaultNow().notNull(),
updatedAt: timestamp("updated_at")
.defaultNow()
.notNull()
.$onUpdate(() => sql`NOW()`),
});
When .array() is removed from categories and ins instead treated as a normal enum, the push works without error
2 replies
DTDrizzle Team
Created by g0053 on 4/19/2024 in #help
Drizzle Kit Studio: Object is not iterable
I am also getting this error (same error code) upon running drizzle-kit push:pg to my local postgres. Drizzle-Kit version 0.20.17 Drizzle-ORM version 0.30.9 using pg version 8.11.3 Also made sure there are no dashes (- )in any fields nor table names. What is most strange is that when this runs, drizzle will recognize the metadata from the journal and ask about each of the tables that should be created or replaced. After running through the whole, set I can notice two of the many tables get created on Drizzle-Studio, while the rest remain uncreated and the console throws the error user g0053 shared. You can see my package for drizzle db stuff and schema here: https://github.com/paulmikulskis/product-eng/tree/main/packages/db Thank you very much for any help!
25 replies