Browse Source

fix: support function calls for default timestamp

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/7218/head
mertmit 9 months ago committed by Ramesh Mane
parent
commit
77214ec156
  1. 7
      packages/nocodb/src/db/sql-client/lib/KnexClient.ts

7
packages/nocodb/src/db/sql-client/lib/KnexClient.ts

@ -3044,7 +3044,12 @@ class KnexClient extends SqlClient {
if (/^\w+\(\)$/.test(value)) return value;
// if value is a CURRENT_TIMESTAMP, return as is
if (/^CURRENT_TIMESTAMP[\w ]*$/.test(value.toUpperCase())) return value;
if (
/^\s*current_timestamp(?:\(\))?(?:\s+on\s+update\s+current_timestamp(?:\(\))?)?\s*$/i.test(
value,
)
)
return value;
// if value wrapped in single/double quotes, then extract value and sanitise
const m = value.match(/^(['"])(.*)\1$/);

Loading…
Cancel
Save