mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01: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[]> { | ||||
|         const sdkPrefix = `${sdkName}%`; | ||||
|         const rows = await this.db | ||||
|             .select() | ||||
|             .from(TABLE) | ||||
|             .whereRaw(`sdk_version LIKE '??%'`, [sdkName]) | ||||
|             .whereLike('sdk_version', sdkPrefix) | ||||
|             .orderBy('last_seen', 'desc'); | ||||
|         return rows.map(mapRow); | ||||
|     } | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user