mirror of
https://github.com/drawdb-io/drawdb.git
synced 2025-09-01 10:25:13 +00:00
Add more keywords for defaults (#553)
* Add more keywords for defaults * Add date functions to check default
This commit is contained in:
@@ -1023,6 +1023,9 @@ const postgresTypesBase = {
|
|||||||
"today",
|
"today",
|
||||||
"tomorrow",
|
"tomorrow",
|
||||||
"yesterday",
|
"yesterday",
|
||||||
|
"current_date",
|
||||||
|
"current_timestamp",
|
||||||
|
"current_time",
|
||||||
];
|
];
|
||||||
return (
|
return (
|
||||||
/^\d{4}-\d{2}-\d{2}$/.test(field.default) ||
|
/^\d{4}-\d{2}-\d{2}$/.test(field.default) ||
|
||||||
|
@@ -33,7 +33,16 @@ export function strHasQuotes(str) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const keywords = ["CURRENT_TIMESTAMP", "NULL"];
|
const keywords = [
|
||||||
|
"NULL",
|
||||||
|
"TRUE",
|
||||||
|
"FALSE",
|
||||||
|
"CURRENT_DATE",
|
||||||
|
"CURRENT_TIME",
|
||||||
|
"CURRENT_TIMESTAMP",
|
||||||
|
"LOCALTIME",
|
||||||
|
"LOCALTIMESTAMP"
|
||||||
|
];
|
||||||
|
|
||||||
export function isKeyword(str) {
|
export function isKeyword(str) {
|
||||||
return keywords.includes(str.toUpperCase());
|
return keywords.includes(str.toUpperCase());
|
||||||
|
Reference in New Issue
Block a user