History

Clarify drizzle generator boundaries

Rhys Sullivan committed 6 months ago

Commit 3e9f3d51 parent b039b6e1 file · +3 −1Browse files

Unified · Split

packages/core/cli/src/generators/drizzle.ts+3−1
@@ -38,6 +38,7 @@ const getType = ( · 37 unmodified lines
3838 mysql: `mysqlEnum([${type.map((x) => `'${x}'`).join(", ")}])`,
3939 }[dialect];
4040 }
41+ // oxlint-disable-next-line executor/no-try-catch-or-throw, executor/no-error-constructor -- boundary: generator rejects invalid schema input through the SchemaGenerator promise API
4142 throw new TypeError(
4243 `Invalid field type for field ${name}`,
4344 );
@@ -95,8 +96,9 @@ const getType = ( · 51 unmodified lines
9596 },
9697 };
9798
98− const dbTypeMap = typeMap[type as string];
99+ const dbTypeMap = typeMap[type];
99100 if (!dbTypeMap) {
101+ // oxlint-disable-next-line executor/no-try-catch-or-throw, executor/no-error-constructor -- boundary: generator rejects unsupported schema input through the SchemaGenerator promise API
100102 throw new Error(
101103 `Unsupported field type '${field.type}' for field '${name}'.`,
102104 );