You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the following field types should be mapped to the relevant prisma types.
we can use this as a starter.
case 'BIGINT':
case 'INT8':
case 'BIGSERIAL':
case 'SERIAL8':
case 'INTEGER':
case 'INT':
case 'INT4':
case 'SMALLINT':
case 'INT2':
case 'SMALLSERIAL':
case 'SERIAL2':
case 'SERIAL':
case 'SERIAL4':
return typeof singleValue === 'number' && Number.isInteger(singleValue);
case 'BIT':
case 'BIT VARYING':
case 'VARBIT':
return typeof singleValue === 'string' && bitPattern.test(singleValue);
case 'BOOLEAN':
case 'BOOL':
return typeof singleValue === 'boolean';
case 'BYTEA':
return typeof singleValue === 'string';
case 'CHARACTER':
case 'CHAR':
case 'CHARACTER VARYING':
case 'VARCHAR':
case 'TEXT':
return typeof singleValue === 'string';
case 'CIDR':
return typeof singleValue === 'string' && cidrPattern.test(singleValue);
case 'INET':
return typeof singleValue === 'string' && inetPattern.test(singleValue);
case 'MACADDR':
return (
typeof singleValue === 'string' && macaddrPattern.test(singleValue)
);
case 'UUID':
return typeof singleValue === 'string' && uuidPattern.test(singleValue);
case 'JSON':
case 'JSONB':
try {
JSON.parse(singleValue);
return true;
} catch (e) {
return false;
}
case 'NUMERIC':
case 'DECIMAL':
case 'MONEY':
case 'DOUBLE PRECISION':
case 'FLOAT8':
case 'REAL':
case 'FLOAT4':
case 'FLOAT':
return typeof singleValue === 'number';
case 'DATE':
case 'TIME':
case 'TIME WITH TIME ZONE':
case 'TIMETZ':
case 'TIMESTAMP':
case 'TIMESTAMP WITH TIME ZONE':
case 'TIMESTAMPTZ':
return typeof singleValue === 'string';
The text was updated successfully, but these errors were encountered:
the following field types should be mapped to the relevant prisma types.
we can use this as a starter.
The text was updated successfully, but these errors were encountered: