missing types
We have a few tables for which the generated type is missing, we are using the latest version of electric-sql 0.9.6 and downgraded prisma to 4.8.1
Here is one of the affected prisma models
enum AttachmentType { DOCUMENT WEBSITE IMAGE ARTICLE PROFILE RESUME PROJECT OTHER }
model Bibliography { id String @id @default(cuid()) name String url String doiID String abstract String? type AttachmentType projectID String project Project @relation(fields: [projectID], references: [id], onDelete: Cascade)
@@index([projectID]) }
here is the schema that is generated with debug mode when generating for the same model, note that "type" is Unsupported even though its a enum
enum AttachmentType { DOCUMENT WEBSITE IMAGE ARTICLE PROFILE RESUME PROJECT OTHER }
model Bibliography { id String @id name String url String doiID String abstract String? type Unsupported("public.AttachmentType") projectID String
@@index([projectID]) @@map("Bibliography") }
here is the respective migration CREATE TABLE "AttachmentResource" ( "id" TEXT NOT NULL, "name" TEXT NOT NULL, "url" TEXT NOT NULL, "description" TEXT, "type" TEXT NOT NULL, "projectActivityLogID" TEXT NOT NULL, CONSTRAINT "AttachmentResource_pkey" PRIMARY KEY ("id") ) WITHOUT ROWID;
CREATE INDEX "AttachmentResource_projectActivityLogID_idx" ON "AttachmentResource" ("projectActivityLogID" ASC);
CREATE TABLE "Bibliography" ( "id" TEXT NOT NULL, "name" TEXT NOT NULL, "url" TEXT NOT NULL, "doiID" TEXT NOT NULL, "abstract" TEXT, "type" TEXT NOT NULL, "projectID" TEXT NOT NULL, CONSTRAINT "Bibliography_pkey" PRIMARY KEY ("id") ) WITHOUT ROWID;
CREATE INDEX "Bibliography_projectID_idx" ON "Bibliography" ("projectID" ASC);
Lastly here is the content generated (src/generated)
Bibliography: { fields: new Map([ [ "id", "TEXT" ], [ "name", "TEXT" ], [ "url", "TEXT" ], [ "doiID", "TEXT" ], [ "abstract", "TEXT" ], [ "projectID", "TEXT" ] ]), relations: [ ], modelSchema: (BibliographyCreateInputSchema as any) .partial() .or((BibliographyUncheckedCreateInputSchema as any).partial()), createSchema: BibliographyCreateArgsSchema, createManySchema: BibliographyCreateManyArgsSchema, findUniqueSchema: BibliographyFindUniqueArgsSchema, findSchema: BibliographyFindFirstArgsSchema, updateSchema: BibliographyUpdateArgsSchema, updateManySchema: BibliographyUpdateManyArgsSchema, upsertSchema: BibliographyUpsertArgsSchema, deleteSchema: BibliographyDeleteArgsSchema, deleteManySchema: BibliographyDeleteManyArgsSchema } as TableSchema< z.infer<typeof BibliographyCreateInputSchema>, Prisma.BibliographyCreateArgs['data'], Prisma.BibliographyUpdateArgs['data'], Prisma.BibliographyFindFirstArgs['select'], Prisma.BibliographyFindFirstArgs['where'], Prisma.BibliographyFindUniqueArgs['where'], never, Prisma.BibliographyFindFirstArgs['orderBy'], Prisma.BibliographyScalarFieldEnum, BibliographyGetPayload
,
Where the following was not generated
BibliographyCreateInputSchema BibliographyUncheckedCreateInputSchema BibliographyCreateArgsSchema BibliographyCreateManyArgsSchema BibliographyUpsertArgsSchema BibliographyCreateInputSchema BibliographyCreateArgs
whilst the rest was generated
I suspect that this has to do with the enum type, but as i understand you support user defined enums ?
Removed all the enums and now it generates with out errors. The question is though that the docs state the enums are somewhat supported, what kind of enums are supported, the above seems like a simple enum type?
Hey @sansavision. Can you share the Postgres view of the table and the enum type? I.e. the output of running \d Bilbiography and \dT AttachmentType.
It would also be helpful to see the contents of the electric.schema table. You can save its dump into a file with
\copy (select * from electric.schema) to schema.csv with csv
👋 we've been working the last month on a rebuild of the Electric server over at a temporary repo https://github.com/electric-sql/electric-next/
You can read more about why we made the decision at https://next.electric-sql.com/about
We're really excited about all the new possibilities the new server brings and we hope you'll check it out soon and give us your feedback.
We're now moving the temporary repo back here. As part of that migration we're closing all the old issues and PRs. We really appreciate you taking the time to investigate and report this issue!