Merge pull request #21 from mattn/remove-order
remove order by for count
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user