Merge pull request #21 from mattn/remove-order
Some checks failed
build cli / make-release (push) Has been cancelled
build cli / build-linux (push) Has been cancelled

remove order by for count
This commit is contained in:
mattn
2024-07-12 12:00:24 +09:00
committed by GitHub
3 changed files with 3 additions and 3 deletions

View File

@@ -154,7 +154,7 @@ func (b MySQLBackend) queryEventsSql(filter nostr.Filter, doCount bool) (string,
COUNT(*)
FROM event WHERE `+
strings.Join(conditions, " AND ")+
" ORDER BY created_at DESC LIMIT ?")
" LIMIT ?")
} else {
query = sqlx.Rebind(sqlx.BindType("mysql"), `SELECT
id, pubkey, created_at, kind, tags, content, sig

View File

@@ -152,7 +152,7 @@ func (b PostgresBackend) queryEventsSql(filter nostr.Filter, doCount bool) (stri
COUNT(*)
FROM event WHERE `+
strings.Join(conditions, " AND ")+
" ORDER BY created_at DESC LIMIT ?")
" LIMIT ?")
} else {
query = sqlx.Rebind(sqlx.BindType("postgres"), `SELECT
id, pubkey, created_at, kind, tags, content, sig

View File

@@ -151,7 +151,7 @@ func (b SQLite3Backend) queryEventsSql(filter nostr.Filter, doCount bool) (strin
COUNT(*)
FROM event WHERE `+
strings.Join(conditions, " AND ")+
" ORDER BY created_at DESC LIMIT ?")
" LIMIT ?")
} else {
query = sqlx.Rebind(sqlx.BindType("sqlite3"), `SELECT
id, pubkey, created_at, kind, tags, content, sig