Merge pull request #253 from rudcode/timetz

Add timetz datatype for postgres
This commit is contained in:
1ilit
2024-10-03 10:23:24 +04:00
committed by GitHub

View File

@@ -909,6 +909,20 @@ const postgresTypesBase = {
hasPrecision: false,
hasQuotes: true,
},
TIMETZ: {
type: "TIMETZ",
checkDefault: (field) => {
const specialValues = ["now", "allballs"];
return (
/^(?:[01]?\d|2[0-3]):[0-5]?\d:[0-5]?\d([+-]\d{2}:\d{2})?$/.test(field.default) ||
specialValues.includes(field.default.toLowerCase())
);
},
hasCheck: false,
isSized: false,
hasPrecision: false,
hasQuotes: true,
},
TIMESTAMP: {
type: "TIMESTAMP",
checkDefault: (field) => {