Skip to content

Commit c8386a0

Browse files
rudcode1ilit
authored andcommitted
Add timetz datatype for postgres
1 parent 468210f commit c8386a0

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/data/datatypes.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -909,6 +909,20 @@ const postgresTypesBase = {
909909
hasPrecision: false,
910910
hasQuotes: true,
911911
},
912+
TIMETZ: {
913+
type: "TIMETZ",
914+
checkDefault: (field) => {
915+
const specialValues = ["now", "allballs"];
916+
return (
917+
/^(?:[01]?\d|2[0-3]):[0-5]?\d:[0-5]?\d([+-]\d{2}:\d{2})?$/.test(field.default) ||
918+
specialValues.includes(field.default.toLowerCase())
919+
);
920+
},
921+
hasCheck: false,
922+
isSized: false,
923+
hasPrecision: false,
924+
hasQuotes: true,
925+
},
912926
TIMESTAMP: {
913927
type: "TIMESTAMP",
914928
checkDefault: (field) => {

0 commit comments

Comments
 (0)