Matt Luo
Matt Luo5mo ago

Does defineEntSchema have a way to set strictTableNameTypes: false ?

In the process of converting my schema.ts to use Convex Ents, I am getting an npx convex dev error for a table I had not previously defined in defineSchema(): Argument of type '"tableName"' is not assignable to parameter of type 'TableNamesInDataModel Adding strictTableNameTypes: false to my defineEntSchema() causes problems in functions.ts:
Argument of type 'EntDataModelFromSchema<SchemaDefinition<{ users: EntDefinition<VObject<{ name: string; tokenIdentifier: string; }, { name: VString<string, "required">; tokenIdentifier: VString<string, "required">; FieldName: VString<string, "required">; }, "required", "name" | "tokenIdentifier">, { ...; }, {}, {}, { ...; } & ... 6 ...' is not assignable to parameter of type 'GenericEntsDataModel'.
Type 'EntDataModelFromSchema<SchemaDefinition<{ users: EntDefinition<VObject<{ name: string; tokenIdentifier: string; }, { name: VString<string, "required">; tokenIdentifier: VString<string, "required">; FieldName: VString<string, "required">; }, "required", "name" | "tokenIdentifier">, { ...; }, {}, {}, { ...; } & ... 6 ...' is not assignable to type 'Record<string, GenericEntModel>'.
'string' index signatures are incompatible.
Property 'edges' is missing in type '{ document: any; fieldPaths: string; indexes: {}; searchIndexes: {}; vectorIndexes: {}; }' but required in type 'GenericEntModel'.
Argument of type 'EntDataModelFromSchema<SchemaDefinition<{ users: EntDefinition<VObject<{ name: string; tokenIdentifier: string; }, { name: VString<string, "required">; tokenIdentifier: VString<string, "required">; FieldName: VString<string, "required">; }, "required", "name" | "tokenIdentifier">, { ...; }, {}, {}, { ...; } & ... 6 ...' is not assignable to parameter of type 'GenericEntsDataModel'.
Type 'EntDataModelFromSchema<SchemaDefinition<{ users: EntDefinition<VObject<{ name: string; tokenIdentifier: string; }, { name: VString<string, "required">; tokenIdentifier: VString<string, "required">; FieldName: VString<string, "required">; }, "required", "name" | "tokenIdentifier">, { ...; }, {}, {}, { ...; } & ... 6 ...' is not assignable to type 'Record<string, GenericEntModel>'.
'string' index signatures are incompatible.
Property 'edges' is missing in type '{ document: any; fieldPaths: string; indexes: {}; searchIndexes: {}; vectorIndexes: {}; }' but required in type 'GenericEntModel'.
0 Replies
No replies yetBe the first to reply to this messageJoin