Browse Source

fix: handle LOG formula function in MSSQL same as other databases

re #949

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/973/head
Pranav C 3 years ago
parent
commit
1664124310
  1. 14
      packages/nocodb/package-lock.json
  2. 2
      packages/nocodb/package.json
  3. 8
      packages/nocodb/src/lib/dataMapper/lib/sql/functionMappings/mssql.ts

14
packages/nocodb/package-lock.json generated

@ -66,7 +66,7 @@
"mysql2": "^2.2.5",
"nanoid": "^3.1.20",
"nc-common": "0.0.6",
"nc-help": "^0.2.27",
"nc-help": "^0.2.30",
"nc-lib-gui": "0.84.6",
"nc-plugin": "^0.1.1",
"ncp": "^2.0.0",
@ -15850,9 +15850,9 @@
}
},
"node_modules/nc-help": {
"version": "0.2.27",
"resolved": "https://registry.npmjs.org/nc-help/-/nc-help-0.2.27.tgz",
"integrity": "sha512-ZB/usRfmC9TNRiHxi34hbaM3vF+1F1iprvo3K9G0AuMxFPKYg9e3FHZoYUWAAc2ko2lNIGh3bFksAKNLcvjuyQ==",
"version": "0.2.30",
"resolved": "https://registry.npmjs.org/nc-help/-/nc-help-0.2.30.tgz",
"integrity": "sha512-mCyqkDuCr9TsyWuHPgPDCjyxSAsh7QveXFMZuxJyjxeRTa+YVt5H+BbAb053xLYz5yk++0+EwPCd2Bf4jDU7BQ==",
"dependencies": {
"axios": "^0.21.1",
"boxen": "^4.2.0",
@ -37147,9 +37147,9 @@
"integrity": "sha512-3AryS9uwa5NfISLxMciUonrH7YfXp+nlahB9T7girXIsLQrmwX4MdnuKs32akduCOGpKmjTJSWmATULbuMkbfw=="
},
"nc-help": {
"version": "0.2.27",
"resolved": "https://registry.npmjs.org/nc-help/-/nc-help-0.2.27.tgz",
"integrity": "sha512-ZB/usRfmC9TNRiHxi34hbaM3vF+1F1iprvo3K9G0AuMxFPKYg9e3FHZoYUWAAc2ko2lNIGh3bFksAKNLcvjuyQ==",
"version": "0.2.30",
"resolved": "https://registry.npmjs.org/nc-help/-/nc-help-0.2.30.tgz",
"integrity": "sha512-mCyqkDuCr9TsyWuHPgPDCjyxSAsh7QveXFMZuxJyjxeRTa+YVt5H+BbAb053xLYz5yk++0+EwPCd2Bf4jDU7BQ==",
"requires": {
"axios": "^0.21.1",
"boxen": "^4.2.0",

2
packages/nocodb/package.json

@ -147,7 +147,7 @@
"mysql2": "^2.2.5",
"nanoid": "^3.1.20",
"nc-common": "0.0.6",
"nc-help": "^0.2.27",
"nc-help": "^0.2.30",
"nc-lib-gui": "0.84.6",
"nc-plugin": "^0.1.1",
"ncp": "^2.0.0",

8
packages/nocodb/src/lib/dataMapper/lib/sql/functionMappings/mssql.ts

@ -50,6 +50,14 @@ const mssql = {
return args.knex.raw(`Case ${query}\n End${args.colAlias}`);
},
LOG: (args: MapFnArgs) => {
return args.knex.raw(
`LOG(${args.pt.arguments
.reverse()
.map(ar => args.fn(ar).toQuery())
.join(',')})${args.colAlias}`
);
},
MOD: pt => {
Object.assign(pt, {
type: 'BinaryExpression',

Loading…
Cancel
Save