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
commit 257209c3e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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) => {