mirror of
https://github.com/fiatjaf/khatru.git
synced 2025-03-28 18:51:52 +01:00
like over instr
This commit is contained in:
parent
b50dad2700
commit
ee301e82d9
@ -102,16 +102,12 @@ func (b SQLite3Backend) QueryEvents(filter *nostr.Filter) (events []nostr.Event,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(tagQuery) > 0 {
|
if len(tagQuery) > 0 {
|
||||||
arrayBuild := make([]string, len(tagQuery))
|
|
||||||
for i, tagValue := range tagQuery {
|
|
||||||
arrayBuild[i] = "?"
|
|
||||||
params = append(params, tagValue)
|
|
||||||
}
|
|
||||||
|
|
||||||
// we use a very bad implementation in which we only check the tag values and
|
// Naive implementation
|
||||||
// ignore the tag names
|
for _, tagValue := range tagQuery {
|
||||||
conditions = append(conditions,
|
params = append(params, "%"+tagValue+"%")
|
||||||
"instr(',"+strings.Join(arrayBuild, ",")+",',tags) IS NOT NULL")
|
conditions = append(conditions, "tags LIKE ?")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if filter.Since != nil {
|
if filter.Since != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user