Fix binding mismatch problem in oneOf queries.
This commit is contained in:
parent
a4b66e00e4
commit
5cb294f33e
|
@ -394,10 +394,9 @@ class InternalBuilder {
|
|||
(key: string, array) => {
|
||||
if (this.client === SqlClient.ORACLE) {
|
||||
key = convertClobs(this.client, table, key)
|
||||
query = query.whereRaw(
|
||||
`${key} IN (?)`,
|
||||
Array.isArray(array) ? array : [array]
|
||||
)
|
||||
array = Array.isArray(array) ? array : [array]
|
||||
const binding = new Array(array.length).fill("?").join(",")
|
||||
query = query.whereRaw(`${key} IN (${binding})`, array)
|
||||
} else {
|
||||
query = query[fnc](key, Array.isArray(array) ? array : [array])
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ export function getNativeSql(
|
|||
query: Knex.SchemaBuilder | Knex.QueryBuilder
|
||||
): SqlQuery | SqlQuery[] {
|
||||
let sql = query.toSQL()
|
||||
|
||||
if (Array.isArray(sql)) {
|
||||
return sql as SqlQuery[]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue