mirror of
https://github.com/Unleash/unleash.git
synced 2025-08-23 13:46:45 +02:00
fix: Use knex whereLike instead of whereRaw to fix escaping (#6041)
This escape with `??` double escaped the LIKE query causing no results. This updates to using whereLike, which does the correct escaping for string query.
This commit is contained in:
parent
32484460ef
commit
32dd377c3e
@ -167,10 +167,11 @@ export default class ClientInstanceStore implements IClientInstanceStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getBySdkName(sdkName: string): Promise<IClientInstance[]> {
|
async getBySdkName(sdkName: string): Promise<IClientInstance[]> {
|
||||||
|
const sdkPrefix = `${sdkName}%`;
|
||||||
const rows = await this.db
|
const rows = await this.db
|
||||||
.select()
|
.select()
|
||||||
.from(TABLE)
|
.from(TABLE)
|
||||||
.whereRaw(`sdk_version LIKE '??%'`, [sdkName])
|
.whereLike('sdk_version', sdkPrefix)
|
||||||
.orderBy('last_seen', 'desc');
|
.orderBy('last_seen', 'desc');
|
||||||
return rows.map(mapRow);
|
return rows.map(mapRow);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user