keep up with the latest specs for since/until filter

This commit is contained in:
jiftechnify
2023-07-15 11:12:35 +09:00
committed by fiatjaf_
parent fb3626feb9
commit e4fe82dd7f
3 changed files with 6 additions and 6 deletions

View File

@@ -74,12 +74,12 @@ func buildDsl(filter *nostr.Filter) ([]byte, error) {
// since
if filter.Since != nil {
dsl.Must(esquery.Range("event.created_at").Gt(filter.Since))
dsl.Must(esquery.Range("event.created_at").Gte(filter.Since))
}
// until
if filter.Until != nil {
dsl.Must(esquery.Range("event.created_at").Lt(filter.Until))
dsl.Must(esquery.Range("event.created_at").Lte(filter.Until))
}
// search

View File

@@ -159,11 +159,11 @@ func (b PostgresBackend) queryEventsSql(filter *nostr.Filter, doCount bool) (str
}
if filter.Since != nil {
conditions = append(conditions, "created_at > ?")
conditions = append(conditions, "created_at >= ?")
params = append(params, filter.Since)
}
if filter.Until != nil {
conditions = append(conditions, "created_at < ?")
conditions = append(conditions, "created_at <= ?")
params = append(params, filter.Until)
}

View File

@@ -154,11 +154,11 @@ func queryEventsSql(filter *nostr.Filter, doCount bool) (string, []any, error) {
}
if filter.Since != nil {
conditions = append(conditions, "created_at > ?")
conditions = append(conditions, "created_at >= ?")
params = append(params, filter.Since)
}
if filter.Until != nil {
conditions = append(conditions, "created_at < ?")
conditions = append(conditions, "created_at <= ?")
params = append(params, filter.Until)
}
if filter.Search != "" {