1
0
Fork 0
mirror of synced 2024-09-20 11:27:56 +12:00
This commit is contained in:
Martin McKeaveney 2024-07-22 21:23:27 +01:00
parent 165d5b7325
commit 537c92b371
5 changed files with 23 additions and 24 deletions

View file

@ -436,10 +436,9 @@ class InternalBuilder {
[value]
)
} else if (SqlClient.ORACLE) {
query = query[fnc](
`${quotedIdentifier(this.client, key)} = ?`,
[value]
)
query = query[fnc](`${quotedIdentifier(this.client, key)} = ?`, [
value,
])
} else {
query = query[fnc](
`COALESCE(${quotedIdentifier(this.client, key)} = ?, FALSE)`,

View file

@ -153,9 +153,9 @@ export function isValidTime(value: string) {
}
export function sqlLog(client: string, query: string, values?: any[]) {
// if (!environment.SQL_LOGGING_ENABLE) {
// return
// }
if (!environment.SQL_LOGGING_ENABLE) {
return
}
let string = `[SQL] [${client.toUpperCase()}] query="${query}"`
if (values) {
string += ` values="${values.join(", ")}"`

View file

@ -24,7 +24,7 @@ import {
getSqlQuery,
HOST_ADDRESS,
} from "./utils"
import {
import oracledb, {
BindParameters,
Connection,
ConnectionAttributes,
@ -33,13 +33,11 @@ import {
} from "oracledb"
import { OracleTable, OracleColumn, OracleColumnsResponse } from "./base/types"
import { sql } from "@budibase/backend-core"
import oracledb from "oracledb"
const Sql = sql.Sql
oracledb.outFormat = oracledb.OUT_FORMAT_OBJECT
interface OracleConfig {
host: string
port: number

View file

@ -260,7 +260,8 @@ describe("SQL query builder", () => {
name: "John",
},
},
}))
})
)
expect(query).not.toEqual({
bindings: ["John", limit, 5000],
@ -276,7 +277,8 @@ describe("SQL query builder", () => {
name: "John",
},
},
}))
})
)
expect(query).toEqual({
bindings: ["John", limit, 5000],