diff --git a/http.go b/http.go index 23bdbc1..6377a00 100644 --- a/http.go +++ b/http.go @@ -114,8 +114,8 @@ func httpServer(ctx context.Context, app *appState) error { defer span.End() args := make([]any, 0, 3) - where := `` - + where := `where feed_id in (select feed_id from feeds where state != 'permanantly-dead')` + uri := r.URL.Query().Get("uri") if uri != "" { feed_id := urlNS.UUID5(uri) @@ -135,7 +135,7 @@ func httpServer(ctx context.Context, app *appState) error { var end int64 err = db.QueryRowContext(ctx, ` - select count(*) n from twts `+where, args...).Scan(&end) + select count(*) n from twts `+where+``, args...).Scan(&end) span.RecordError(err) if offset < 1 { @@ -162,9 +162,9 @@ func httpServer(ctx context.Context, app *appState) error { coalesce(uri, 'https://empty.txt') uri, text FROM twts - left join ( + join ( select feed_id, nick, uri - from feeds + from feeds ) using (feed_id) where rowid in ( select rowid from twts @@ -174,7 +174,7 @@ func httpServer(ctx context.Context, app *appState) error { offset ? ) order by ulid asc` - + fmt.Println(qry, args) w.Header().Set("Content-Type", "text/plain; charset=utf-8") rows, err := db.QueryContext(