tidy
This commit is contained in:
parent
165d5b7325
commit
537c92b371
5 changed files with 23 additions and 24 deletions
|
@ -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)`,
|
||||
|
|
|
@ -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(", ")}"`
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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],
|
||||
|
|
Loading…
Reference in a new issue