Skip to content

Commit

Permalink
Add timetz datatype for postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
rudcode authored and 1ilit committed Oct 11, 2024
1 parent 468210f commit c8386a0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/data/datatypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit c8386a0

Please sign in to comment.