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(*)
|
COUNT(*)
|
||||||
FROM event WHERE `+
|
FROM event WHERE `+
|
||||||
strings.Join(conditions, " AND ")+
|
strings.Join(conditions, " AND ")+
|
||||||
" ORDER BY created_at DESC LIMIT ?")
|
" LIMIT ?")
|
||||||
} else {
|
} else {
|
||||||
query = sqlx.Rebind(sqlx.BindType("mysql"), `SELECT
|
query = sqlx.Rebind(sqlx.BindType("mysql"), `SELECT
|
||||||
id, pubkey, created_at, kind, tags, content, sig
|
id, pubkey, created_at, kind, tags, content, sig
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ func (b PostgresBackend) queryEventsSql(filter nostr.Filter, doCount bool) (stri
|
|||||||
COUNT(*)
|
COUNT(*)
|
||||||
FROM event WHERE `+
|
FROM event WHERE `+
|
||||||
strings.Join(conditions, " AND ")+
|
strings.Join(conditions, " AND ")+
|
||||||
" ORDER BY created_at DESC LIMIT ?")
|
" LIMIT ?")
|
||||||
} else {
|
} else {
|
||||||
query = sqlx.Rebind(sqlx.BindType("postgres"), `SELECT
|
query = sqlx.Rebind(sqlx.BindType("postgres"), `SELECT
|
||||||
id, pubkey, created_at, kind, tags, content, sig
|
id, pubkey, created_at, kind, tags, content, sig
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ func (b SQLite3Backend) queryEventsSql(filter nostr.Filter, doCount bool) (strin
|
|||||||
COUNT(*)
|
COUNT(*)
|
||||||
FROM event WHERE `+
|
FROM event WHERE `+
|
||||||
strings.Join(conditions, " AND ")+
|
strings.Join(conditions, " AND ")+
|
||||||
" ORDER BY created_at DESC LIMIT ?")
|
" LIMIT ?")
|
||||||
} else {
|
} else {
|
||||||
query = sqlx.Rebind(sqlx.BindType("sqlite3"), `SELECT
|
query = sqlx.Rebind(sqlx.BindType("sqlite3"), `SELECT
|
||||||
id, pubkey, created_at, kind, tags, content, sig
|
id, pubkey, created_at, kind, tags, content, sig
|
||||||
|
|||||||
Reference in New Issue
Block a user