mirror of
https://github.com/drawdb-io/drawdb.git
synced 2025-08-29 02:25:26 +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",
|
||||
"tomorrow",
|
||||
"yesterday",
|
||||
"current_date",
|
||||
"current_timestamp",
|
||||
"current_time",
|
||||
];
|
||||
return (
|
||||
/^\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) {
|
||||
return keywords.includes(str.toUpperCase());
|
||||
|
Reference in New Issue
Block a user