Skip to content

Commit 21a68e9

Browse files
authored
Add more keywords for defaults (#553)
* Add more keywords for defaults * Add date functions to check default
1 parent 2d7c2c6 commit 21a68e9

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/data/datatypes.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,6 +1023,9 @@ const postgresTypesBase = {
10231023
"today",
10241024
"tomorrow",
10251025
"yesterday",
1026+
"current_date",
1027+
"current_timestamp",
1028+
"current_time",
10261029
];
10271030
return (
10281031
/^\d{4}-\d{2}-\d{2}$/.test(field.default) ||

src/utils/utils.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,16 @@ export function strHasQuotes(str) {
3333
);
3434
}
3535

36-
const keywords = ["CURRENT_TIMESTAMP", "NULL"];
36+
const keywords = [
37+
"NULL",
38+
"TRUE",
39+
"FALSE",
40+
"CURRENT_DATE",
41+
"CURRENT_TIME",
42+
"CURRENT_TIMESTAMP",
43+
"LOCALTIME",
44+
"LOCALTIMESTAMP"
45+
];
3746

3847
export function isKeyword(str) {
3948
return keywords.includes(str.toUpperCase());

0 commit comments

Comments
 (0)