PIT: address PR suggestions

This commit is contained in:
carlosmonastyrski
2025-05-21 19:42:09 -03:00
parent 2493bbbc97
commit f06004370d
31 changed files with 862 additions and 576 deletions

View File

@@ -84,6 +84,10 @@ const getZodDefaultValue = (type: unknown, value: string | number | boolean | Ob
}
};
const bigIntegerColumns = {
"folder_commits": ["commitId"]
}
const main = async () => {
const tables = (
await db("information_schema.tables")
@@ -108,6 +112,9 @@ const main = async () => {
const columnName = columnNames[colNum];
const colInfo = columns[columnName];
let ztype = getZodPrimitiveType(colInfo.type);
if (bigIntegerColumns[tableName]?.includes(columnName)) {
ztype = "z.coerce.bigint()";
}
if (["zodBuffer"].includes(ztype)) {
zodImportSet.add(ztype);
}