Browse Source

fix: support function calls for default timestamp

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/7232/head
mertmit 11 months ago
parent
commit
c9424157c6
  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 (/^\w+\(\)$/.test(value)) return value;
// if value is a CURRENT_TIMESTAMP, return as is // 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 // if value wrapped in single/double quotes, then extract value and sanitise
const m = value.match(/^(['"])(.*)\1$/); const m = value.match(/^(['"])(.*)\1$/);

Loading…
Cancel
Save