|
|
@ -3,7 +3,10 @@ import { jsepCurlyHook, UITypes } from 'nocodb-sdk'; |
|
|
|
import mapFunctionName from '../mapFunctionName'; |
|
|
|
import mapFunctionName from '../mapFunctionName'; |
|
|
|
import genRollupSelectv2 from '../genRollupSelectv2'; |
|
|
|
import genRollupSelectv2 from '../genRollupSelectv2'; |
|
|
|
import FormulaColumn from '../../models/FormulaColumn'; |
|
|
|
import FormulaColumn from '../../models/FormulaColumn'; |
|
|
|
import { convertDateFormatForConcat, validateDateWithUnknownFormat } from '../../helpers/formulaFnHelper'; |
|
|
|
import { |
|
|
|
|
|
|
|
convertDateFormatForConcat, |
|
|
|
|
|
|
|
validateDateWithUnknownFormat, |
|
|
|
|
|
|
|
} from '../../helpers/formulaFnHelper'; |
|
|
|
import { CacheGetType, CacheScope } from '../../utils/globals'; |
|
|
|
import { CacheGetType, CacheScope } from '../../utils/globals'; |
|
|
|
import NocoCache from '../../cache/NocoCache'; |
|
|
|
import NocoCache from '../../cache/NocoCache'; |
|
|
|
import type { XKnex } from '../CustomKnex'; |
|
|
|
import type { XKnex } from '../CustomKnex'; |
|
|
@ -640,7 +643,7 @@ async function _formulaQueryBuilder( |
|
|
|
arg, |
|
|
|
arg, |
|
|
|
columnIdToUidt, |
|
|
|
columnIdToUidt, |
|
|
|
query, |
|
|
|
query, |
|
|
|
knex.clientType() |
|
|
|
knex.clientType(), |
|
|
|
); |
|
|
|
); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// sqlite3: special handling - See BinaryExpression
|
|
|
|
// sqlite3: special handling - See BinaryExpression
|
|
|
@ -657,9 +660,9 @@ async function _formulaQueryBuilder( |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return query; |
|
|
|
return query; |
|
|
|
}) |
|
|
|
}), |
|
|
|
) |
|
|
|
) |
|
|
|
).join()})${colAlias}`.replace(/\?/g, '\\?')
|
|
|
|
).join()})${colAlias}`.replace(/\?/g, '\\?'),
|
|
|
|
), |
|
|
|
), |
|
|
|
}; |
|
|
|
}; |
|
|
|
} else if (pt.type === 'Literal') { |
|
|
|
} else if (pt.type === 'Literal') { |
|
|
@ -741,13 +744,13 @@ async function _formulaQueryBuilder( |
|
|
|
pt.left?.arguments?.[0], |
|
|
|
pt.left?.arguments?.[0], |
|
|
|
columnIdToUidt, |
|
|
|
columnIdToUidt, |
|
|
|
left, |
|
|
|
left, |
|
|
|
knex.clientType() |
|
|
|
knex.clientType(), |
|
|
|
); |
|
|
|
); |
|
|
|
right = await convertDateFormatForConcat( |
|
|
|
right = await convertDateFormatForConcat( |
|
|
|
pt.right?.arguments?.[0], |
|
|
|
pt.right?.arguments?.[0], |
|
|
|
columnIdToUidt, |
|
|
|
columnIdToUidt, |
|
|
|
right, |
|
|
|
right, |
|
|
|
knex.clientType() |
|
|
|
knex.clientType(), |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// handle NULL values when calling CONCAT for sqlite3
|
|
|
|
// handle NULL values when calling CONCAT for sqlite3
|
|
|
|